Skip to content

Latest commit

 

History

History
327 lines (223 loc) · 10.5 KB

ProjectsApi.md

File metadata and controls

327 lines (223 loc) · 10.5 KB

Phrase\ProjectsApi

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

Method HTTP request Description
projectCreate POST /projects Create a project
projectDelete DELETE /projects/{id} Delete a project
projectShow GET /projects/{id} Get a single project
projectUpdate PATCH /projects/{id} Update a project
projectsList GET /projects List projects

projectCreate

\Phrase\Model\ProjectDetails projectCreate($project_create_parameters, $x_phrase_app_otp)

Create a project

Create a new project.

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\ProjectsApi(
    // 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_create_parameters = new \Phrase\Model\ProjectCreateParameters(); // \Phrase\Model\ProjectCreateParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $result = $apiInstance->projectCreate($project_create_parameters, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProjectsApi->projectCreate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_create_parameters \Phrase\Model\ProjectCreateParameters
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\ProjectDetails

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]

projectDelete

projectDelete($id, $x_phrase_app_otp)

Delete a project

Delete an existing project.

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\ProjectsApi(
    // 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 | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

Name Type Description Notes
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]

projectShow

\Phrase\Model\ProjectDetails projectShow($id, $x_phrase_app_otp)

Get a single project

Get details on a single project.

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\ProjectsApi(
    // 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 | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

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

Return type

\Phrase\Model\ProjectDetails

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]

projectUpdate

\Phrase\Model\ProjectDetails projectUpdate($id, $project_update_parameters, $x_phrase_app_otp)

Update a project

Update an existing project.

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\ProjectsApi(
    // 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 | ID
$project_update_parameters = new \Phrase\Model\ProjectUpdateParameters(); // \Phrase\Model\ProjectUpdateParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

Name Type Description Notes
id string ID
project_update_parameters \Phrase\Model\ProjectUpdateParameters
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\ProjectDetails

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]

projectsList

\Phrase\Model\Project[] projectsList($x_phrase_app_otp, $page, $per_page, $account_id, $sort_by, $filters)

List projects

List all projects the current user has access to.

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\ProjectsApi(
    // 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
);
$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
$account_id = 'account_id_example'; // string | Filter by Account ID
$sort_by = 'sort_by_example'; // string | Sort projects. Valid options are \"name_asc\", \"name_desc\", \"updated_at_asc\", \"updated_at_desc\", \"space_asc\" and \"space_desc\".
$filters = favorites; // string[] | Filter projects. Valid options are [\"favorites\"].

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

Parameters

Name Type Description Notes
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]
account_id string Filter by Account ID [optional]
sort_by string Sort projects. Valid options are &quot;name_asc&quot;, &quot;name_desc&quot;, &quot;updated_at_asc&quot;, &quot;updated_at_desc&quot;, &quot;space_asc&quot; and &quot;space_desc&quot;. [optional]
filters string[] Filter projects. Valid options are [&quot;favorites&quot;]. [optional]

Return type

\Phrase\Model\Project[]

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]