All URIs are relative to https://api.phrase.com/v2
Method | HTTP request | Description |
---|---|---|
orderConfirm | PATCH /projects/{project_id}/orders/{id}/confirm | Confirm an order |
orderCreate | POST /projects/{project_id}/orders | Create a new order |
orderDelete | DELETE /projects/{project_id}/orders/{id} | Cancel an order |
orderShow | GET /projects/{project_id}/orders/{id} | Get a single order |
ordersList | GET /projects/{project_id}/orders | List orders |
\Phrase\Model\TranslationOrder orderConfirm($project_id, $id, $order_confirm_parameters, $x_phrase_app_otp)
Confirm an order
Confirm an existing order and send it to the provider for translation. Same constraints as for create.
<?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\OrdersApi(
// 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
);
$project_id = 'project_id_example'; // string | Project ID
$id = 'id_example'; // string | ID
$order_confirm_parameters = new \Phrase\Model\OrderConfirmParameters(); // \Phrase\Model\OrderConfirmParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->orderConfirm($project_id, $id, $order_confirm_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->orderConfirm: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
project_id | string | Project ID | |
id | string | ID | |
order_confirm_parameters | \Phrase\Model\OrderConfirmParameters | ||
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\TranslationOrder
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\TranslationOrder orderCreate($project_id, $order_create_parameters, $x_phrase_app_otp)
Create a new order
Create a new order. Access token scope must include orders.create
.
<?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\OrdersApi(
// 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
);
$project_id = 'project_id_example'; // string | Project ID
$order_create_parameters = new \Phrase\Model\OrderCreateParameters(); // \Phrase\Model\OrderCreateParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->orderCreate($project_id, $order_create_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->orderCreate: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
project_id | string | Project ID | |
order_create_parameters | \Phrase\Model\OrderCreateParameters | ||
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\TranslationOrder
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
orderDelete($project_id, $id, $x_phrase_app_otp, $branch)
Cancel an order
Cancel an existing order. Must not yet be confirmed.
<?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\OrdersApi(
// 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
);
$project_id = 'project_id_example'; // string | Project ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
$branch = my-feature-branch; // string | specify the branch to use
try {
$apiInstance->orderDelete($project_id, $id, $x_phrase_app_otp, $branch);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->orderDelete: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
project_id | string | Project ID | |
id | string | ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
branch | string | specify the branch to use | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\TranslationOrder orderShow($project_id, $id, $x_phrase_app_otp, $branch)
Get a single order
Get details on a single order.
<?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\OrdersApi(
// 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
);
$project_id = 'project_id_example'; // string | Project ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
$branch = my-feature-branch; // string | specify the branch to use
try {
$result = $apiInstance->orderShow($project_id, $id, $x_phrase_app_otp, $branch);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->orderShow: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
project_id | string | Project ID | |
id | string | ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
branch | string | specify the branch to use | [optional] |
\Phrase\Model\TranslationOrder
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\TranslationOrder[] ordersList($project_id, $x_phrase_app_otp, $page, $per_page, $branch)
List orders
List all orders for the given project.
<?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\OrdersApi(
// 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
);
$project_id = 'project_id_example'; // string | Project 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
$branch = my-feature-branch; // string | specify the branch to use
try {
$result = $apiInstance->ordersList($project_id, $x_phrase_app_otp, $page, $per_page, $branch);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrdersApi->ordersList: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
project_id | string | Project 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] |
branch | string | specify the branch to use | [optional] |
\Phrase\Model\TranslationOrder[]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]