2017 © Pedro Peláez
 

library yammer-oauth2-php

An OAuth2 Wrapper for Yammer

image

stephenyeargin/yammer-oauth2-php

An OAuth2 Wrapper for Yammer

  • Monday, September 11, 2017
  • by stephenyeargin
  • Repository
  • 2 Watchers
  • 10 Stars
  • 675 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 2 Versions
  • 22 % Grown

The README.md

Yammer OAuth2 for PHP

CI Build and Test, (*1)

PHP wrapper for Yammer's API., (*2)

Install

Install with Composer:, (*3)

$ composer require stephenyeargin/yammer-oauth2-php

Usage

Example configuration array passed to constructor:, (*4)

$config['consumer_key'] = '1ABCdefhiJKLmnop';
$config['consumer_secret'] = 'ABCdefhi_JKLmnop';
$config['callbackUrl'] = 'http://' . $_SERVER['SERVER_NAME'] . '/yammer/callback/';

$yammer = new YammerPHP\YammerPHP($config);

Starting the callback process:, (*5)

// Redirect the user to the OAuth page for your application
header('Location: ' . $yammer->getAuthorizationUrl());

Upgrading the callback code to an authorization token:, (*6)

$code = $_GET['code'];
$token = $yammer->getAccessToken($code);

Using the token (either from a fresh process or saved in the database), (*7)

$yammer->setOAuthToken($token);

Making a call with the $yammer instance:, (*8)

if (!$yammer->testAuth()) {
    // Handle this.
}

// Retrieve feed for authenticated user
try {
    $feed = $yammer->get('messages/my_feed.json');
    print_r($feed);
} catch (YammerPHPException $e) {
    print 'Error: ';
    print $e->getMessage();
}

The Versions

11/09 2017

dev-master

9999999-dev

An OAuth2 Wrapper for Yammer

  Sources   Download

MIT

The Development Requires

by Stephen Yeargin

09/11 2015

v1.0.0

1.0.0.0

An OAuth2 Wrapper for Yammer

  Sources   Download

MIT

The Development Requires

by Stephen Yeargin