1. Go to this page and download the library: Download zero-to-prod/spapi-tokens 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/ */
zero-to-prod / spapi-tokens example snippets
use Zerotoprod\SpapiTokens\SpapiTokens;
$response = SpapiTokens::from('access_token','targetApplication')
->createRestrictedDataToken('path', ['dataElements']);
$response['response']['restrictedDataToken'];
$response['response']['expiresIn'];
use Zerotoprod\SpapiTokens\SpapiTokens;
use Zerotoprod\SpapiTokens\Support\Testing\SpapiTokensResponseFactory;
use Zerotoprod\SpapiTokens\Support\Testing\SpapiTokensFake;
SpapiTokensFake::fake(
SpapiTokensResponseFactory::factory()->make()
);
$response = SpapiTokens::from('access_token','targetApplication')
->createRestrictedDataToken('path', ['dataElements']);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.