1. Go to this page and download the library: Download creads/partners-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
creads / partners-api example snippets
use Creads\Partners\Client;
use Creads\Partners\OAuthAccessToken;
$authentication = new OAuthAuthenticationToken('CLIENT_ID', 'CLIENT_SECRET');
$client = new Client($authentication);
use Creads\Partners\Client;
use Creads\Partners\BearerAccessToken;
// Here we get a token
// $authentication = new OAuthAuthenticationToken(...);
// $access_token = $authentication->getAccessToken();
$client = new Client(new BearerAccessToken($access_token));
use Creads\Partners\Webhook;
$webhook = new Webhook('your_secret');
if (!$webhook->isSignatureValid($receivedSignature, $receivedJsonBody)) {
throw new Exception('...');
}