Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ada PHP SDK

This is an API wrapper PHP library given as a facility to properly access ADA API. It automatically request an access token to the OAuth2 API endpoint and stores it in PHP session, as well as requesting a new access token when the stored one is found expired.


Usage

Using the Ada PHP SDK is as simple as:

  1. Clone, Fork or download the source code

  2. Configure it with your Swithcer's client_id and secret provided by the ADA platform:

    require_once 'src/AdaSdk.php';
    $config = array(
        'applicationName' => 'YOUR_OWN_APP_NAME',
        'clientID'=>'YOUR_CLIENT_ID',
        'clientSecret'=>'YOUR_CLIENT_SECRET',
        'url'=>'YOUR_ADA_INSTALLATION_URL',
        'silentMode'=>true
    );

    The applicationName is any string of your own that will identify your application in browser session and basically prevents session variables to overlap. You can comment or set silentMode to false to not have AdaSdkException thrown if an error is returned from the API call.

  3. Instantiate a new AdaSdk object and use it:

    $adasdk = new \ADASdk\AdaSdk($config);	
    /**
     * load a user in json format
     */
    $user = $adasdk->get('users',array('id'=>A_USER_ID));

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages