Skip to content

Latest commit

 

History

History
174 lines (123 loc) · 5.24 KB

ComposerTokenApi.md

File metadata and controls

174 lines (123 loc) · 5.24 KB

Yoast\MyYoastApiClient\ComposerTokenApi

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

Method HTTP request Description
disable POST /api/ComposerTokens/{id}/delete Disable a composer token
generate POST /api/ComposerTokens/generate Generates a Composer token
rename POST /api/ComposerTokens/{id}/rename Renames a Composer token

disable

\Yoast\MyYoastApiClient\Model\ComposerToken disable($id)

Disable a composer token

Renders a single composer token unusable

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\ComposerTokenApi(
    // 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 = "id_example"; // string | 

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

Parameters

Name Type Description Notes
id string

Return type

\Yoast\MyYoastApiClient\Model\ComposerToken

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]

generate

\Yoast\MyYoastApiClient\Model\ComposerToken generate($body)

Generates a Composer token

Generates a personal token for the logged in customer that can be used to download our plugins with Composer.

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\ComposerTokenApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\GenerateDto(); // \Yoast\MyYoastApiClient\Model\GenerateDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\GenerateDto

Return type

\Yoast\MyYoastApiClient\Model\ComposerToken

Authorization

bearer

HTTP request headers

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

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

rename

\Yoast\MyYoastApiClient\Model\ComposerToken rename($body, $id)

Renames a Composer token

Changes the name of a Composer token

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\ComposerTokenApi(
    // 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
);
$body = new \Yoast\MyYoastApiClient\Model\RenameBodyDto(); // \Yoast\MyYoastApiClient\Model\RenameBodyDto | 
$id = "id_example"; // string | 

try {
    $result = $apiInstance->rename($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ComposerTokenApi->rename: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\RenameBodyDto
id string

Return type

\Yoast\MyYoastApiClient\Model\ComposerToken

Authorization

bearer

HTTP request headers

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

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