All URIs are relative to https://api.phrase.com/v2
| Method | HTTP request | Description |
|---|---|---|
| keyCreate | POST /projects/{project_id}/keys | Create a key |
| keyDelete | DELETE /projects/{project_id}/keys/{id} | Delete a key |
| keyShow | GET /projects/{project_id}/keys/{id} | Get a single key |
| keyUpdate | PATCH /projects/{project_id}/keys/{id} | Update a key |
| keysDeleteCollection | DELETE /projects/{project_id}/keys | Delete collection of keys |
| keysExclude | PATCH /projects/{project_id}/keys/exclude | Exclude a locale on a collection of keys |
| keysInclude | PATCH /projects/{project_id}/keys/include | Include a locale on a collection of keys |
| keysList | GET /projects/{project_id}/keys | List keys |
| keysSearch | POST /projects/{project_id}/keys/search | Search keys |
| keysTag | PATCH /projects/{project_id}/keys/tag | Add tags to collection of keys |
| keysUntag | PATCH /projects/{project_id}/keys/untag | Remove tags from collection of keys |
\Phrase\Model\TranslationKeyDetails keyCreate($project_id, $key_create_parameters, $x_phrase_app_otp)
Create a key
Create a new key.
<?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\KeysApi(
// 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
$key_create_parameters = new \Phrase\Model\KeyCreateParameters(); // \Phrase\Model\KeyCreateParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->keyCreate($project_id, $key_create_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keyCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| key_create_parameters | \Phrase\Model\KeyCreateParameters | ||
| x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\TranslationKeyDetails
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
keyDelete($project_id, $id, $x_phrase_app_otp, $branch)
Delete a key
Delete an existing key.
<?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\KeysApi(
// 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->keyDelete($project_id, $id, $x_phrase_app_otp, $branch);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keyDelete: ', $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\TranslationKeyDetails keyShow($project_id, $id, $x_phrase_app_otp, $branch)
Get a single key
Get details on a single key for a 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\KeysApi(
// 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->keyShow($project_id, $id, $x_phrase_app_otp, $branch);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keyShow: ', $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\TranslationKeyDetails
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\TranslationKeyDetails keyUpdate($project_id, $id, $key_update_parameters, $x_phrase_app_otp)
Update a key
Update an existing key.
<?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\KeysApi(
// 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
$key_update_parameters = new \Phrase\Model\KeyUpdateParameters(); // \Phrase\Model\KeyUpdateParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->keyUpdate($project_id, $id, $key_update_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keyUpdate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| id | string | ID | |
| key_update_parameters | \Phrase\Model\KeyUpdateParameters | ||
| x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\TranslationKeyDetails
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\AffectedResources keysDeleteCollection($project_id, $x_phrase_app_otp, $branch, $q, $locale_id)
Delete collection of keys
Delete all keys matching query. Same constraints as list. Please limit the number of affected keys to about 1,000 as you might experience timeouts otherwise.
<?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\KeysApi(
// 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)
$branch = my-feature-branch; // string | specify the branch to use
$q = mykey* translated:true; // string | Specify a query to do broad search for keys by name (including wildcards). The following qualifiers are also supported in the search term: - `ids:key_id,...` for queries on a comma-separated list of ids - `name:key_name` for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes - `tags:tag_name` to filter for keys with certain tags - `translated:{true|false}` for translation status (also requires `locale_id` to be specified) - `updated_at:{>=|<=}2013-02-21T00:00:00Z` for date range queries - `unmentioned_in_upload:upload_id,...` to filter keys unmentioned within upload. When multiple upload IDs provided, matches only keys not mentioned in **all** uploads **Caution:** Query parameters with empty values will be treated as though they are not included in the request and will be ignored. Find more examples [here](/en/api/strings/usage-examples).
$locale_id = abcd1234abcd1234abcd1234abcd1234; // string | Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
try {
$result = $apiInstance->keysDeleteCollection($project_id, $x_phrase_app_otp, $branch, $q, $locale_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keysDeleteCollection: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
| branch | string | specify the branch to use | [optional] |
| q | string | Specify a query to do broad search for keys by name (including wildcards). The following qualifiers are also supported in the search term: - `ids:key_id,...` for queries on a comma-separated list of ids - `name:key_name` for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes - `tags:tag_name` to filter for keys with certain tags - `translated:{true | false}` for translation status (also requires `locale_id` to be specified) - `updated_at:{>= |
| locale_id | string | Locale used to determine the translation state of a key when filtering for untranslated or translated keys. | [optional] |
\Phrase\Model\AffectedResources
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\AffectedResources keysExclude($project_id, $keys_exclude_parameters, $x_phrase_app_otp)
Exclude a locale on a collection of keys
Exclude a locale on keys matching query. Same constraints as list.
<?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\KeysApi(
// 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
$keys_exclude_parameters = new \Phrase\Model\KeysExcludeParameters(); // \Phrase\Model\KeysExcludeParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->keysExclude($project_id, $keys_exclude_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keysExclude: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| keys_exclude_parameters | \Phrase\Model\KeysExcludeParameters | ||
| x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\AffectedResources
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\AffectedResources keysInclude($project_id, $keys_include_parameters, $x_phrase_app_otp)
Include a locale on a collection of keys
Include a locale on keys matching query. Same constraints as list.
<?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\KeysApi(
// 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
$keys_include_parameters = new \Phrase\Model\KeysIncludeParameters(); // \Phrase\Model\KeysIncludeParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->keysInclude($project_id, $keys_include_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keysInclude: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| keys_include_parameters | \Phrase\Model\KeysIncludeParameters | ||
| x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\AffectedResources
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\TranslationKey[] keysList($project_id, $x_phrase_app_otp, $page, $per_page, $branch, $sort, $order, $q, $locale_id)
List keys
List all keys for the given project. Alternatively you can POST requests to /search.
<?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\KeysApi(
// 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
$sort = updated_at; // string | Sort by field. Can be one of: name, created_at, updated_at.
$order = desc; // string | Order direction. Can be one of: asc, desc.
$q = mykey* translated:true; // string | Specify a query to do broad search for keys by name (including wildcards). The following qualifiers are also supported in the search term: - `ids:key_id,...` for queries on a comma-separated list of ids - `name:key_name` for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes - `tags:tag_name` to filter for keys with certain tags - `translated:{true|false}` for translation status (also requires `locale_id` to be specified) - `updated_at:{>=|<=}2013-02-21T00:00:00Z` for date range queries - `unmentioned_in_upload:upload_id,...` to filter keys unmentioned within upload. When multiple upload IDs provided, matches only keys not mentioned in **all** uploads **Caution:** Query parameters with empty values will be treated as though they are not included in the request and will be ignored. Find more examples [here](/en/api/strings/usage-examples).
$locale_id = abcd1234abcd1234abcd1234abcd1234; // string | Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
try {
$result = $apiInstance->keysList($project_id, $x_phrase_app_otp, $page, $per_page, $branch, $sort, $order, $q, $locale_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keysList: ', $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] |
| sort | string | Sort by field. Can be one of: name, created_at, updated_at. | [optional] |
| order | string | Order direction. Can be one of: asc, desc. | [optional] |
| q | string | Specify a query to do broad search for keys by name (including wildcards). The following qualifiers are also supported in the search term: - `ids:key_id,...` for queries on a comma-separated list of ids - `name:key_name` for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes - `tags:tag_name` to filter for keys with certain tags - `translated:{true | false}` for translation status (also requires `locale_id` to be specified) - `updated_at:{>= |
| locale_id | string | Locale used to determine the translation state of a key when filtering for untranslated or translated keys. | [optional] |
\Phrase\Model\TranslationKey[]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\TranslationKey[] keysSearch($project_id, $keys_search_parameters, $x_phrase_app_otp, $page, $per_page)
Search keys
Search keys for the given project matching query.
<?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\KeysApi(
// 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
$keys_search_parameters = new \Phrase\Model\KeysSearchParameters(); // \Phrase\Model\KeysSearchParameters |
$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->keysSearch($project_id, $keys_search_parameters, $x_phrase_app_otp, $page, $per_page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keysSearch: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| keys_search_parameters | \Phrase\Model\KeysSearchParameters | ||
| 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] |
\Phrase\Model\TranslationKey[]
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\AffectedResources keysTag($project_id, $keys_tag_parameters, $x_phrase_app_otp)
Add tags to collection of keys
Tags all keys matching query. Same constraints as list.
<?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\KeysApi(
// 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
$keys_tag_parameters = new \Phrase\Model\KeysTagParameters(); // \Phrase\Model\KeysTagParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->keysTag($project_id, $keys_tag_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keysTag: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| keys_tag_parameters | \Phrase\Model\KeysTagParameters | ||
| x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\AffectedResources
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\AffectedResources keysUntag($project_id, $keys_untag_parameters, $x_phrase_app_otp)
Remove tags from collection of keys
Removes specified tags from keys matching query.
<?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\KeysApi(
// 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
$keys_untag_parameters = new \Phrase\Model\KeysUntagParameters(); // \Phrase\Model\KeysUntagParameters |
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
try {
$result = $apiInstance->keysUntag($project_id, $keys_untag_parameters, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KeysApi->keysUntag: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | string | Project ID | |
| keys_untag_parameters | \Phrase\Model\KeysUntagParameters | ||
| x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
\Phrase\Model\AffectedResources
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]