Skip to content

Bigpoint/platform-php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP - SDK

This PHP - SDK helps developer to use an Oauth2 secured platform.

Build Status Coverage Status Dependency Status

Example

<?php
require 'vendor/autoload.php';

$config = array(
    'client_id'     => 'CLIENTID',
    'client_secret' => 'CLIENTSECRET',
    'grant_type'    => 'authorization_code',
    //'grant_type'    => 'client_credentials',
    'redirect_uri'  => 'http://localhost', // optional, otherwise the current URI will used
);

$factory  = new Bigpoint\Factory();
$api      = $factory->createApi($config);
try {
    $user_id = $api->getUser();
    if (null !== $user_id) {
        $response = $api->call('/me');
        echo $response->getContent();
    }
} catch (Exception $e) {
    echo $e->getMessage();
}

The URI at which a request for an authorization will be serviced.

<?php
// ...
$api->getAuthorizationRequestUri();

Tests

The tests can be executed by using the phpunit command line tool from the base directory.

phpunit

The coverage report will generated to base directory/coverage.

The Xdebug extension is required otherwise no code coverage will be generated.

Releases

No releases published

Packages

No packages published

Languages