Skip to content

Latest commit

 

History

History
289 lines (205 loc) · 9.92 KB

CommentReactionsApi.md

File metadata and controls

289 lines (205 loc) · 9.92 KB

Phrase\CommentReactionsApi

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

Method HTTP request Description
reactionCreate POST /projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions Create a reaction
reactionDelete DELETE /projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions/{id} Delete a reaction
reactionShow GET /projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions/{id} Get a single reaction
reactionsList GET /projects/{project_id}/keys/{key_id}/comments/{comment_id}/reactions List reactions

reactionCreate

\Phrase\Model\CommentReaction reactionCreate($project_id, $key_id, $comment_id, $x_phrase_app_otp, $branch, $emoji)

Create a reaction

Create a new reaction for a 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\CommentReactionsApi(
    // 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_id = 'comment_id_example'; // string | Comment 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
$emoji = 👍; // string | specify the emoji for the reaction

try {
    $result = $apiInstance->reactionCreate($project_id, $key_id, $comment_id, $x_phrase_app_otp, $branch, $emoji);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommentReactionsApi->reactionCreate: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

\Phrase\Model\CommentReaction

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]

reactionDelete

reactionDelete($project_id, $key_id, $comment_id, $id, $x_phrase_app_otp, $branch)

Delete a reaction

Delete an existing reaction.

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\CommentReactionsApi(
    // 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_id = 'comment_id_example'; // string | Comment 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->reactionDelete($project_id, $key_id, $comment_id, $id, $x_phrase_app_otp, $branch);
} catch (Exception $e) {
    echo 'Exception when calling CommentReactionsApi->reactionDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
comment_id string Comment 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]

reactionShow

\Phrase\Model\CommentReaction reactionShow($project_id, $key_id, $comment_id, $id, $x_phrase_app_otp, $branch)

Get a single reaction

Get details on a single reaction.

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\CommentReactionsApi(
    // 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_id = 'comment_id_example'; // string | Comment 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->reactionShow($project_id, $key_id, $comment_id, $id, $x_phrase_app_otp, $branch);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommentReactionsApi->reactionShow: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
comment_id string Comment 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\CommentReaction

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]

reactionsList

\Phrase\Model\CommentReaction[] reactionsList($project_id, $key_id, $comment_id, $x_phrase_app_otp, $page, $per_page, $branch)

List reactions

List all reactions for a 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\CommentReactionsApi(
    // 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_id = 'comment_id_example'; // string | Comment 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
$branch = my-feature-branch; // string | specify the branch to use

try {
    $result = $apiInstance->reactionsList($project_id, $key_id, $comment_id, $x_phrase_app_otp, $page, $per_page, $branch);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CommentReactionsApi->reactionsList: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
project_id string Project ID
key_id string Translation Key ID
comment_id string Comment 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]
branch string specify the branch to use [optional]

Return type

\Phrase\Model\CommentReaction[]

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]