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 comment_create(project_id, key_id, comment_create_parameters, opts)
Create a comment
Create a new comment for a key.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
comment_create_parameters = Phrase::CommentCreateParameters.new({message: 'Some message...'}) # CommentCreateParameters |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}
begin
#Create a comment
result = api_instance.comment_create(project_id, key_id, comment_create_parameters, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comment_create: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
project_id | String | Project ID | |
key_id | String | Translation Key ID | |
comment_create_parameters | CommentCreateParameters | ||
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
Response<(Comment)>
- Content-Type: application/json
- Accept: application/json
comment_delete(project_id, key_id, id, opts)
Delete a comment
Delete an existing comment.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
id = 'id_example' # String | ID
opts = {
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
}
begin
#Delete a comment
api_instance.comment_delete(project_id, key_id, id, opts)
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comment_delete: #{e}"
end
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] |
Response<(nil (empty response body))>
- Content-Type: Not defined
- Accept: Not defined
comment_mark_check(project_id, key_id, id, opts)
Check if comment is read
Check if comment was marked as read. Returns 204 if read, 404 if unread.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
id = 'id_example' # String | ID
opts = {
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
}
begin
#Check if comment is read
api_instance.comment_mark_check(project_id, key_id, id, opts)
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comment_mark_check: #{e}"
end
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] |
Response<(nil (empty response body))>
- Content-Type: Not defined
- Accept: Not defined
comment_mark_read(project_id, key_id, id, comment_mark_read_parameters, opts)
Mark a comment as read
Mark a comment as read.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
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 = Phrase::CommentMarkReadParameters.new # CommentMarkReadParameters |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}
begin
#Mark a comment as read
api_instance.comment_mark_read(project_id, key_id, id, comment_mark_read_parameters, opts)
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comment_mark_read: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
project_id | String | Project ID | |
key_id | String | Translation Key ID | |
id | String | ID | |
comment_mark_read_parameters | CommentMarkReadParameters | ||
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
Response<(nil (empty response body))>
- Content-Type: application/json
- Accept: Not defined
comment_mark_unread(project_id, key_id, id, opts)
Mark a comment as unread
Mark a comment as unread.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
id = 'id_example' # String | ID
opts = {
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
}
begin
#Mark a comment as unread
api_instance.comment_mark_unread(project_id, key_id, id, opts)
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comment_mark_unread: #{e}"
end
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] |
Response<(nil (empty response body))>
- Content-Type: Not defined
- Accept: Not defined
Comment comment_show(project_id, key_id, id, opts)
Get a single comment
Get details on a single comment.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
id = 'id_example' # String | ID
opts = {
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
}
begin
#Get a single comment
result = api_instance.comment_show(project_id, key_id, id, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comment_show: #{e}"
end
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] |
Response<(Comment)>
- Content-Type: Not defined
- Accept: application/json
Comment comment_update(project_id, key_id, id, comment_update_parameters, opts)
Update a comment
Update an existing comment.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
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 = Phrase::CommentUpdateParameters.new # CommentUpdateParameters |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}
begin
#Update a comment
result = api_instance.comment_update(project_id, key_id, id, comment_update_parameters, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comment_update: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
project_id | String | Project ID | |
key_id | String | Translation Key ID | |
id | String | ID | |
comment_update_parameters | CommentUpdateParameters | ||
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
Response<(Comment)>
- Content-Type: application/json
- Accept: application/json
Array<Comment> comments_list(project_id, key_id, comments_list_parameters, opts)
List comments
List all comments for a key.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::CommentsApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
comments_list_parameters = Phrase::CommentsListParameters.new # CommentsListParameters |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
page: 1, # Integer | Page number
per_page: 25, # Integer | 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: ['inner_example'], # Array<String> | Search comments by their assigned locales
filters: ['inner_example'], # Array<String> | Specify the filter for the comments
order: 'desc' # String | Order direction. Can be one of: asc, desc.
}
begin
#List comments
result = api_instance.comments_list(project_id, key_id, comments_list_parameters, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling CommentsApi->comments_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
project_id | String | Project ID | |
key_id | String | Translation Key ID | |
comments_list_parameters | CommentsListParameters | ||
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
page | Integer | Page number | [optional] |
per_page | Integer | 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 | Array<String> | Search comments by their assigned locales | [optional] |
filters | Array<String> | Specify the filter for the comments | [optional] |
order | String | Order direction. Can be one of: asc, desc. | [optional] |
Response<(Array<Comment>)>
- Content-Type: application/json
- Accept: application/json