Skip to content

Latest commit

 

History

History
529 lines (365 loc) · 16.8 KB

SpacesApi.md

File metadata and controls

529 lines (365 loc) · 16.8 KB

Phrase\SpacesApi

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

Method HTTP request Description
spaceCreate POST /accounts/{account_id}/spaces Create a Space
spaceDelete DELETE /accounts/{account_id}/spaces/{id} Delete Space
spaceShow GET /accounts/{account_id}/spaces/{id} Get Space
spaceUpdate PATCH /accounts/{account_id}/spaces/{id} Update Space
spacesList GET /accounts/{account_id}/spaces List Spaces
spacesProjectsCreate POST /accounts/{account_id}/spaces/{space_id}/projects Add Project to Space
spacesProjectsDelete DELETE /accounts/{account_id}/spaces/{space_id}/projects/{id} Remove Project from Space
spacesProjectsList GET /accounts/{account_id}/spaces/{space_id}/projects List Projects in Space

spaceCreate

\Phrase\Model\Space spaceCreate($account_id, $space_create_parameters, $x_phrase_app_otp)

Create a Space

Create a new Space.

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

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

Parameters

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

Return type

\Phrase\Model\Space

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]

spaceDelete

spaceDelete($account_id, $id, $x_phrase_app_otp)

Delete Space

Delete the specified Space.

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\SpacesApi(
    // 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->spaceDelete($account_id, $id, $x_phrase_app_otp);
} catch (Exception $e) {
    echo 'Exception when calling SpacesApi->spaceDelete: ', $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]

spaceShow

\Phrase\Model\Space spaceShow($account_id, $id, $x_phrase_app_otp)

Get Space

Show the specified Space.

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\SpacesApi(
    // 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->spaceShow($account_id, $id, $x_phrase_app_otp);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SpacesApi->spaceShow: ', $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\Space

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]

spaceUpdate

\Phrase\Model\Space spaceUpdate($account_id, $id, $space_update_parameters, $x_phrase_app_otp)

Update Space

Update the specified Space.

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

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

Parameters

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

Return type

\Phrase\Model\Space

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]

spacesList

\Phrase\Model\Space[] spacesList($account_id, $x_phrase_app_otp, $page, $per_page)

List Spaces

List all Spaces 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\SpacesApi(
    // 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->spacesList($account_id, $x_phrase_app_otp, $page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SpacesApi->spacesList: ', $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\Space[]

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]

spacesProjectsCreate

spacesProjectsCreate($account_id, $space_id, $spaces_projects_create_parameters, $x_phrase_app_otp)

Add Project to Space

Adds an existing project to the space.

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\SpacesApi(
    // 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
$space_id = 'space_id_example'; // string | Space ID
$spaces_projects_create_parameters = new \Phrase\Model\SpacesProjectsCreateParameters(); // \Phrase\Model\SpacesProjectsCreateParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $apiInstance->spacesProjectsCreate($account_id, $space_id, $spaces_projects_create_parameters, $x_phrase_app_otp);
} catch (Exception $e) {
    echo 'Exception when calling SpacesApi->spacesProjectsCreate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
space_id string Space ID
spaces_projects_create_parameters \Phrase\Model\SpacesProjectsCreateParameters
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: application/json
  • Accept: Not defined

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

spacesProjectsDelete

spacesProjectsDelete($account_id, $space_id, $id, $x_phrase_app_otp)

Remove Project from Space

Removes a specified project from the specified space.

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\SpacesApi(
    // 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
$space_id = 'space_id_example'; // string | Space ID
$id = 'id_example'; // string | ID
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

Name Type Description Notes
account_id string Account ID
space_id string Space 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]

spacesProjectsList

\Phrase\Model\Project[] spacesProjectsList($account_id, $space_id, $x_phrase_app_otp, $page, $per_page)

List Projects in Space

List all projects for the specified Space.

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\SpacesApi(
    // 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
$space_id = 'space_id_example'; // string | Space 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->spacesProjectsList($account_id, $space_id, $x_phrase_app_otp, $page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SpacesApi->spacesProjectsList: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
account_id string Account ID
space_id string Space 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\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]