Skip to content

Latest commit

 

History

History
331 lines (227 loc) · 10.8 KB

DistributionsApi.md

File metadata and controls

331 lines (227 loc) · 10.8 KB

Phrase\DistributionsApi

All URIs are relative to https://api.phrase.com/v2

Method HTTP request Description
distributionCreate POST /accounts/{account_id}/distributions Create a distribution
distributionDelete DELETE /accounts/{account_id}/distributions/{id} Delete a distribution
distributionShow GET /accounts/{account_id}/distributions/{id} Get a single distribution
distributionUpdate PATCH /accounts/{account_id}/distributions/{id} Update a distribution
distributionsList GET /accounts/{account_id}/distributions List distributions

distributionCreate

\Phrase\Model\Distribution distributionCreate($account_id, $distribution_create_parameters, $x_phrase_app_otp)

Create a distribution

Create a new distribution.

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\DistributionsApi(
    // 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
);
$account_id = 'account_id_example'; // string | Account ID
$distribution_create_parameters = new \Phrase\Model\DistributionCreateParameters(); // \Phrase\Model\DistributionCreateParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->distributionCreate($account_id, $distribution_create_parameters, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DistributionsApi->distributionCreate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
distribution_create_parameters \Phrase\Model\DistributionCreateParameters
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\Distribution

Authorization

Basic, Token

HTTP request headers

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

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

distributionDelete

distributionDelete($account_id, $id, $x_phrase_app_otp)

Delete a distribution

Delete an existing distribution.

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\DistributionsApi(
    // 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
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $apiInstance->distributionDelete($account_id, $id, $x_phrase_app_otp);
} catch (Exception $e) {
    echo 'Exception when calling DistributionsApi->distributionDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

void (empty response body)

Authorization

Basic, Token

HTTP request headers

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

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

distributionShow

\Phrase\Model\Distribution distributionShow($account_id, $id, $x_phrase_app_otp)

Get a single distribution

Get details on a single distribution.

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\DistributionsApi(
    // 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
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\Distribution

Authorization

Basic, Token

HTTP request headers

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

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

distributionUpdate

\Phrase\Model\Distribution distributionUpdate($account_id, $id, $distribution_update_parameters, $x_phrase_app_otp)

Update a distribution

Update an existing distribution.

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\DistributionsApi(
    // 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
);
$account_id = 'account_id_example'; // string | Account ID
$id = 'id_example'; // string | ID
$distribution_update_parameters = new \Phrase\Model\DistributionUpdateParameters(); // \Phrase\Model\DistributionUpdateParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->distributionUpdate($account_id, $id, $distribution_update_parameters, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DistributionsApi->distributionUpdate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
id string ID
distribution_update_parameters \Phrase\Model\DistributionUpdateParameters
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\Distribution

Authorization

Basic, Token

HTTP request headers

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

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

distributionsList

\Phrase\Model\DistributionPreview[] distributionsList($account_id, $x_phrase_app_otp, $page, $per_page)

List distributions

List all distributions for the given account.

Example

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

$config = Phrase\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
$config = Phrase\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'token');

$apiInstance = new Phrase\Api\DistributionsApi(
    // 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
);
$account_id = 'account_id_example'; // string | Account ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
$page = 1; // int | Page number
$per_page = 25; // int | Limit on the number of objects to be returned, between 1 and 100. 25 by default

try {
    $result = $apiInstance->distributionsList($account_id, $x_phrase_app_otp, $page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DistributionsApi->distributionsList: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]
page int Page number [optional]
per_page int Limit on the number of objects to be returned, between 1 and 100. 25 by default [optional]

Return type

\Phrase\Model\DistributionPreview[]

Authorization

Basic, Token

HTTP request headers

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

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