Skip to content

Latest commit

 

History

History
333 lines (229 loc) · 11.2 KB

MembersApi.md

File metadata and controls

333 lines (229 loc) · 11.2 KB

Phrase\MembersApi

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

Method HTTP request Description
memberDelete DELETE /accounts/{account_id}/members/{id} Remove a user from the account
memberShow GET /accounts/{account_id}/members/{id} Get single member
memberUpdate PATCH /accounts/{account_id}/members/{id} Update a member
memberUpdateSettings PATCH /projects/{project_id}/members/{id} Update a member's project settings
membersList GET /accounts/{account_id}/members List members

memberDelete

memberDelete($account_id, $id, $x_phrase_app_otp)

Remove a user from the account

Remove a user from the account. The user will be removed from the account but not deleted from Phrase. Access token scope must include team.manage.

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

memberShow

\Phrase\Model\Member memberShow($account_id, $id, $x_phrase_app_otp)

Get single member

Get details on a single user in the account. Access token scope must include team.manage.

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

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]

memberUpdate

\Phrase\Model\Member memberUpdate($account_id, $id, $member_update_parameters, $x_phrase_app_otp)

Update a member

Update user permissions in the account. Developers and translators need project_ids and locale_ids assigned to access them. Access token scope must include team.manage.

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

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

Parameters

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

Return type

\Phrase\Model\Member

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]

memberUpdateSettings

\Phrase\Model\MemberProjectDetail memberUpdateSettings($project_id, $id, $member_update_settings_parameters, $x_phrase_app_otp)

Update a member's project settings

Update user settings in the project. Access token scope must include team.manage.

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

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

Parameters

Name Type Description Notes
project_id string Project ID
id string ID
member_update_settings_parameters \Phrase\Model\MemberUpdateSettingsParameters
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\MemberProjectDetail

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]

membersList

\Phrase\Model\Member[] membersList($account_id, $x_phrase_app_otp, $page, $per_page)

List members

Get all users active in the account. It also lists resources like projects and locales the member has access to. In case nothing is shown the default access from the role is used. Access token scope must include team.manage.

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\MembersApi(
    // 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->membersList($account_id, $x_phrase_app_otp, $page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling MembersApi->membersList: ', $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\Member[]

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]