Skip to content

Latest commit

 

History

History
562 lines (398 loc) · 19.4 KB

CommentsApi.md

File metadata and controls

562 lines (398 loc) · 19.4 KB

Phrase\CommentsApi

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

Method HTTP request Description
commentCreate POST /projects/{project_id}/keys/{key_id}/comments Create a comment
commentDelete DELETE /projects/{project_id}/keys/{key_id}/comments/{id} Delete a comment
commentMarkCheck GET /projects/{project_id}/keys/{key_id}/comments/{id}/read Check if comment is read
commentMarkRead PATCH /projects/{project_id}/keys/{key_id}/comments/{id}/read Mark a comment as read
commentMarkUnread DELETE /projects/{project_id}/keys/{key_id}/comments/{id}/read Mark a comment as unread
commentShow GET /projects/{project_id}/keys/{key_id}/comments/{id} Get a single comment
commentUpdate PATCH /projects/{project_id}/keys/{key_id}/comments/{id} Update a comment
commentsList GET /projects/{project_id}/keys/{key_id}/comments List comments

commentCreate

\Phrase\Model\Comment commentCreate($project_id, $key_id, $comment_create_parameters, $x_phrase_app_otp, $message, $locale_ids)

Create a comment

Create a new comment for a key.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key ID
$comment_create_parameters = new \Phrase\Model\CommentCreateParameters(); // \Phrase\Model\CommentCreateParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)
$message = some message...; // string | specify the message for the comment
$locale_ids = someId; // string[] | specify the locales for the comment

try {
    $result = $apiInstance->commentCreate($project_id, $key_id, $comment_create_parameters, $x_phrase_app_otp, $message, $locale_ids);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommentsApi->commentCreate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
comment_create_parameters \Phrase\Model\CommentCreateParameters
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]
message string specify the message for the comment [optional]
locale_ids string[] specify the locales for the comment [optional]

Return type

\Phrase\Model\Comment

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]

commentDelete

commentDelete($project_id, $key_id, $id, $x_phrase_app_otp, $branch)

Delete a comment

Delete an existing comment.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key 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->commentDelete($project_id, $key_id, $id, $x_phrase_app_otp, $branch);
} catch (Exception $e) {
    echo 'Exception when calling CommentsApi->commentDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]
branch string specify the branch to use [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]

commentMarkCheck

commentMarkCheck($project_id, $key_id, $id, $x_phrase_app_otp, $branch)

Check if comment is read

Check if comment was marked as read. Returns 204 if read, 404 if unread.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key 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->commentMarkCheck($project_id, $key_id, $id, $x_phrase_app_otp, $branch);
} catch (Exception $e) {
    echo 'Exception when calling CommentsApi->commentMarkCheck: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]
branch string specify the branch to use [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]

commentMarkRead

commentMarkRead($project_id, $key_id, $id, $comment_mark_read_parameters, $x_phrase_app_otp)

Mark a comment as read

Mark a comment as read.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key ID
$id = 'id_example'; // string | ID
$comment_mark_read_parameters = new \Phrase\Model\CommentMarkReadParameters(); // \Phrase\Model\CommentMarkReadParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

try {
    $apiInstance->commentMarkRead($project_id, $key_id, $id, $comment_mark_read_parameters, $x_phrase_app_otp);
} catch (Exception $e) {
    echo 'Exception when calling CommentsApi->commentMarkRead: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
id string ID
comment_mark_read_parameters \Phrase\Model\CommentMarkReadParameters
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]

commentMarkUnread

commentMarkUnread($project_id, $key_id, $id, $x_phrase_app_otp, $branch)

Mark a comment as unread

Mark a comment as unread.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key 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->commentMarkUnread($project_id, $key_id, $id, $x_phrase_app_otp, $branch);
} catch (Exception $e) {
    echo 'Exception when calling CommentsApi->commentMarkUnread: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]
branch string specify the branch to use [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]

commentShow

\Phrase\Model\Comment commentShow($project_id, $key_id, $id, $x_phrase_app_otp, $branch)

Get a single comment

Get details on a single comment.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key 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->commentShow($project_id, $key_id, $id, $x_phrase_app_otp, $branch);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommentsApi->commentShow: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
id string ID
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]
branch string specify the branch to use [optional]

Return type

\Phrase\Model\Comment

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]

commentUpdate

\Phrase\Model\Comment commentUpdate($project_id, $key_id, $id, $comment_update_parameters, $x_phrase_app_otp)

Update a comment

Update an existing comment.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key ID
$id = 'id_example'; // string | ID
$comment_update_parameters = new \Phrase\Model\CommentUpdateParameters(); // \Phrase\Model\CommentUpdateParameters | 
$x_phrase_app_otp = 'x_phrase_app_otp_example'; // string | Two-Factor-Authentication token (optional)

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

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
id string ID
comment_update_parameters \Phrase\Model\CommentUpdateParameters
x_phrase_app_otp string Two-Factor-Authentication token (optional) [optional]

Return type

\Phrase\Model\Comment

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]

commentsList

\Phrase\Model\Comment[] commentsList($project_id, $key_id, $comments_list_parameters, $x_phrase_app_otp, $page, $per_page, $branch, $query, $locale_ids, $filters, $order)

List comments

List all comments for a key.

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\CommentsApi(
    // 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_id = 'key_id_example'; // string | Translation Key ID
$comments_list_parameters = new \Phrase\Model\CommentsListParameters(); // \Phrase\Model\CommentsListParameters | 
$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
$query = Some comment content; // string | Search query for comment messages
$locale_ids = ["someId"]; // string[] | Search comments by their assigned locales
$filters = ["read","unread"]; // string[] | Specify the filter for the comments
$order = desc; // string | Order direction. Can be one of: asc, desc.

try {
    $result = $apiInstance->commentsList($project_id, $key_id, $comments_list_parameters, $x_phrase_app_otp, $page, $per_page, $branch, $query, $locale_ids, $filters, $order);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommentsApi->commentsList: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
comments_list_parameters \Phrase\Model\CommentsListParameters
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]
query string Search query for comment messages [optional]
locale_ids string[] Search comments by their assigned locales [optional]
filters string[] Specify the filter for the comments [optional]
order string Order direction. Can be one of: asc, desc. [optional]

Return type

\Phrase\Model\Comment[]

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]