Skip to content

Latest commit

 

History

History
598 lines (442 loc) · 24.1 KB

CommentsApi.md

File metadata and controls

598 lines (442 loc) · 24.1 KB

phrase_api.CommentsApi

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

Method HTTP request Description
comment_create POST /projects/{project_id}/keys/{key_id}/comments Create a comment
comment_delete DELETE /projects/{project_id}/keys/{key_id}/comments/{id} Delete a comment
comment_mark_check GET /projects/{project_id}/keys/{key_id}/comments/{id}/read Check if comment is read
comment_mark_read PATCH /projects/{project_id}/keys/{key_id}/comments/{id}/read Mark a comment as read
comment_mark_unread DELETE /projects/{project_id}/keys/{key_id}/comments/{id}/read Mark a comment as unread
comment_show GET /projects/{project_id}/keys/{key_id}/comments/{id} Get a single comment
comment_update PATCH /projects/{project_id}/keys/{key_id}/comments/{id} Update a comment
comments_list GET /projects/{project_id}/keys/{key_id}/comments List comments

comment_create

Comment comment_create(project_id, key_id, comment_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Create a comment

Create a new comment for a key.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    comment_create_parameters = phrase_api.CommentCreateParameters() # CommentCreateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Create a comment
        api_response = api_instance.comment_create(project_id, key_id, comment_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CommentsApi->comment_create: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
key_id str Translation Key ID
comment_create_parameters CommentCreateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

Comment

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

comment_delete

comment_delete(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Delete a comment

Delete an existing comment.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    branch = 'my-feature-branch' # str | specify the branch to use

    try:
        # Delete a comment
        api_instance.comment_delete(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
    except ApiException as e:
        print("Exception when calling CommentsApi->comment_delete: %s\n" % e)

Parameters

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

HTTP response details

Status code Description Response headers
204 The resource was deleted successfully. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

comment_mark_check

comment_mark_check(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Check if comment is read

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

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    branch = 'my-feature-branch' # str | specify the branch to use

    try:
        # Check if comment is read
        api_instance.comment_mark_check(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
    except ApiException as e:
        print("Exception when calling CommentsApi->comment_mark_check: %s\n" % e)

Parameters

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

HTTP response details

Status code Description Response headers
204 The resource was deleted successfully. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

comment_mark_read

comment_mark_read(project_id, key_id, id, comment_mark_read_parameters, x_phrase_app_otp=x_phrase_app_otp)

Mark a comment as read

Mark a comment as read.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    id = 'id_example' # str | ID (required)
    comment_mark_read_parameters = phrase_api.CommentMarkReadParameters() # CommentMarkReadParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Mark a comment as read
        api_instance.comment_mark_read(project_id, key_id, id, comment_mark_read_parameters, x_phrase_app_otp=x_phrase_app_otp)
    except ApiException as e:
        print("Exception when calling CommentsApi->comment_mark_read: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
key_id str Translation Key ID
id str ID
comment_mark_read_parameters CommentMarkReadParameters
x_phrase_app_otp str 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

HTTP response details

Status code Description Response headers
204 The resource was deleted successfully. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

comment_mark_unread

comment_mark_unread(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Mark a comment as unread

Mark a comment as unread.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    branch = 'my-feature-branch' # str | specify the branch to use

    try:
        # Mark a comment as unread
        api_instance.comment_mark_unread(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
    except ApiException as e:
        print("Exception when calling CommentsApi->comment_mark_unread: %s\n" % e)

Parameters

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

HTTP response details

Status code Description Response headers
204 The resource was deleted successfully. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

comment_show

Comment comment_show(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Get a single comment

Get details on a single comment.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    branch = 'my-feature-branch' # str | specify the branch to use

    try:
        # Get a single comment
        api_response = api_instance.comment_show(project_id, key_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CommentsApi->comment_show: %s\n" % e)

Parameters

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

Return type

Comment

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

comment_update

Comment comment_update(project_id, key_id, id, comment_update_parameters, x_phrase_app_otp=x_phrase_app_otp)

Update a comment

Update an existing comment.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    id = 'id_example' # str | ID (required)
    comment_update_parameters = phrase_api.CommentUpdateParameters() # CommentUpdateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Update a comment
        api_response = api_instance.comment_update(project_id, key_id, id, comment_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CommentsApi->comment_update: %s\n" % e)

Parameters

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

Return type

Comment

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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

comments_list

List[Comment] comments_list(project_id, key_id, comments_list_parameters, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch, query=query, locale_ids=locale_ids, filters=filters, order=order)

List comments

List all comments for a key.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.CommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    comments_list_parameters = phrase_api.CommentsListParameters() # CommentsListParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | 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' # str | specify the branch to use
    query = 'Some comment content' # str | Search query for comment messages
    locale_ids = ['[\"someId\"]'] # List[str] | Search comments by their assigned locales
    filters = ['[\"read\",\"unread\"]'] # List[str] | Specify the filter for the comments
    order = 'desc' # str | Order direction. Can be one of: asc, desc.

    try:
        # List comments
        api_response = api_instance.comments_list(project_id, key_id, comments_list_parameters, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch, query=query, locale_ids=locale_ids, filters=filters, order=order)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CommentsApi->comments_list: %s\n" % e)

Parameters

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

Return type

List[Comment]

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
* Link -
* Pagination -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

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