1. Go to this page and download the library: Download radweb/oauth-token-encoding 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/ */
radweb / oauth-token-encoding example snippets
// grab the "Accept" header from your request and pass it in
$accept = 'application/xml';
// create an access token
$oauthToken = [
"access_token" => "2YotnFZFEjr1zCsicMWpAA",
"token_type" => "example",
"expires_in" => 3600,
"refresh_token" => "tGzv3JOkF0XG5Qx2TlKWIA",
"example_parameter" => "example_value",
];
$encoder = new OAuthTokenEncoder;
list($contentType, $body) = $encoder->encode($accept, $oauthToken);
// return a response using the given body & content type