All URIs are relative to https://api.phrase.com/v2
Method | HTTP request | Description |
---|---|---|
repoSyncActivate | POST /accounts/{account_id}/repo_syncs/{id}/activate | Activate a Repo Sync |
repoSyncDeactivate | POST /accounts/{account_id}/repo_syncs/{id}/deactivate | Deactivate a Repo Sync |
repoSyncExport | POST /accounts/{account_id}/repo_syncs/{id}/export | Export to code repository |
repoSyncImport | POST /accounts/{account_id}/repo_syncs/{id}/import | Import from code repository |
repoSyncList | GET /accounts/{account_id}/repo_syncs | Get Repo Syncs |
repoSyncShow | GET /accounts/{account_id}/repo_syncs/{id} | Get a single Repo Sync |
\Phrase\Model\RepoSync repoSyncActivate($account_id, $id, $x_phrase_app_otp)
Activate a Repo Sync
Activate a deactivated Repo Sync. Active syncs can be used to import and export translations, and imports to Phrase are automatically triggered by pushes to the repository, if configured.
<?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\RepoSyncsApi(
// 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->repoSyncActivate($account_id, $id, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RepoSyncsApi->repoSyncActivate: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
account_id | string | Account ID | |
id | string | ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\RepoSync repoSyncDeactivate($account_id, $id, $x_phrase_app_otp)
Deactivate a Repo Sync
Deactivate an active Repo Sync. Import and export can't be performed on deactivated syncs and the pushes to the repository won't trigger the import to Phrase.
<?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\RepoSyncsApi(
// 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->repoSyncDeactivate($account_id, $id, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RepoSyncsApi->repoSyncDeactivate: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
account_id | string | Account ID | |
id | string | ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\RepoSyncEvent repoSyncExport($account_id, $id, $x_phrase_app_otp)
Export to code repository
Export translations from Phrase Strings to repository provider according to the .phrase.yml file within the code repository. Export is done asynchronously and may take several seconds depending on the project size.
<?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\RepoSyncsApi(
// 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->repoSyncExport($account_id, $id, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RepoSyncsApi->repoSyncExport: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
account_id | string | Account ID | |
id | string | ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\RepoSyncEvent repoSyncImport($account_id, $id, $x_phrase_app_otp)
Import from code repository
Import translations from repository provider to Phrase Strings according to the .phrase.yml file within the code repository. Import is done asynchronously and may take several seconds depending on the project size.
<?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\RepoSyncsApi(
// 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->repoSyncImport($account_id, $id, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RepoSyncsApi->repoSyncImport: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
account_id | string | Account ID | |
id | string | ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\RepoSync[] repoSyncList($account_id, $x_phrase_app_otp)
Get Repo Syncs
Lists all Repo Syncs from an account
<?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\RepoSyncsApi(
// 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)
try {
$result = $apiInstance->repoSyncList($account_id, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RepoSyncsApi->repoSyncList: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
account_id | string | Account ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Phrase\Model\RepoSync repoSyncShow($account_id, $id, $x_phrase_app_otp)
Get a single Repo Sync
Shows a single Repo Sync setting.
<?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\RepoSyncsApi(
// 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->repoSyncShow($account_id, $id, $x_phrase_app_otp);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling RepoSyncsApi->repoSyncShow: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
account_id | string | Account ID | |
id | string | ID | |
x_phrase_app_otp | string | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]