Skip to content

Latest commit

 

History

History
220 lines (154 loc) · 6.33 KB

LicensingApi.md

File metadata and controls

220 lines (154 loc) · 6.33 KB

Yoast\MyYoastApiClient\LicensingApi

All URIs are relative to https://my.yoast.test

Method HTTP request Description
getMany GET /api/licenses Gets licenses
getManyPaged GET /api/licenses/paged Gets licenses
getValidity GET /api/licenses/{id}/validity Gets the current status of a license
processEvent POST /api/licensing/events

getMany

\Yoast\MyYoastApiClient\Model\License[] getMany($filter)

Gets licenses

Get and filter PLS licenses

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\LicensingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$filter = new \stdClass; // object | Used for filtering/joining the results.

try {
    $result = $apiInstance->getMany($filter);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LicensingApi->getMany: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
filter object Used for filtering/joining the results. [optional]

Return type

\Yoast\MyYoastApiClient\Model\License[]

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getManyPaged

\Yoast\MyYoastApiClient\Model\License[] getManyPaged($filter)

Gets licenses

Get and filter PLS licenses

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\LicensingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$filter = new \stdClass; // object | Used for filtering/joining the results.

try {
    $result = $apiInstance->getManyPaged($filter);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LicensingApi->getManyPaged: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
filter object Used for filtering/joining the results. [optional]

Return type

\Yoast\MyYoastApiClient\Model\License[]

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getValidity

getValidity($id)

Gets the current status of a license

Checks against PLS to get the current status of a license

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\LicensingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

try {
    $apiInstance->getValidity($id);
} catch (Exception $e) {
    echo 'Exception when calling LicensingApi->getValidity: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id string

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

processEvent

processEvent($body, $authorization)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Yoast\MyYoastApiClient\Api\LicensingApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = new \Yoast\MyYoastApiClient\Model\EventDto(); // \Yoast\MyYoastApiClient\Model\EventDto | 
$authorization = "authorization_example"; // string | The API shared secret

try {
    $apiInstance->processEvent($body, $authorization);
} catch (Exception $e) {
    echo 'Exception when calling LicensingApi->processEvent: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\EventDto
authorization string The API shared secret

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]