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 |
Comment commentCreate(projectId, keyId, commentCreateParameters, xPhraseAppOTP)
Create a comment
Create a new comment for a key.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
CommentCreateParameters commentCreateParameters = new CommentCreateParameters(); // CommentCreateParameters |
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
try {
Comment result = apiInstance.commentCreate(projectId, keyId, commentCreateParameters, xPhraseAppOTP);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentCreate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
commentCreateParameters | CommentCreateParameters | ||
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: application/json
- Accept: application/json
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 - |
commentDelete(projectId, keyId, id, xPhraseAppOTP, branch)
Delete a comment
Delete an existing comment.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
String id = "id_example"; // String | ID
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
String branch = "my-feature-branch"; // String | specify the branch to use
try {
apiInstance.commentDelete(projectId, keyId, id, xPhraseAppOTP, branch);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentDelete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
id | String | ID | |
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
branch | String | specify the branch to use | [optional] |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
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 - |
commentMarkCheck(projectId, keyId, id, xPhraseAppOTP, branch)
Check if comment is read
Check if comment was marked as read. Returns 204 if read, 404 if unread.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
String id = "id_example"; // String | ID
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
String branch = "my-feature-branch"; // String | specify the branch to use
try {
apiInstance.commentMarkCheck(projectId, keyId, id, xPhraseAppOTP, branch);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentMarkCheck");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
id | String | ID | |
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
branch | String | specify the branch to use | [optional] |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
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 - |
commentMarkRead(projectId, keyId, id, commentMarkReadParameters, xPhraseAppOTP)
Mark a comment as read
Mark a comment as read.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
String id = "id_example"; // String | ID
CommentMarkReadParameters commentMarkReadParameters = new CommentMarkReadParameters(); // CommentMarkReadParameters |
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
try {
apiInstance.commentMarkRead(projectId, keyId, id, commentMarkReadParameters, xPhraseAppOTP);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentMarkRead");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
id | String | ID | |
commentMarkReadParameters | CommentMarkReadParameters | ||
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
null (empty response body)
- Content-Type: application/json
- Accept: Not defined
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 - |
commentMarkUnread(projectId, keyId, id, xPhraseAppOTP, branch)
Mark a comment as unread
Mark a comment as unread.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
String id = "id_example"; // String | ID
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
String branch = "my-feature-branch"; // String | specify the branch to use
try {
apiInstance.commentMarkUnread(projectId, keyId, id, xPhraseAppOTP, branch);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentMarkUnread");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
id | String | ID | |
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
branch | String | specify the branch to use | [optional] |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
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 - |
Comment commentShow(projectId, keyId, id, xPhraseAppOTP, branch)
Get a single comment
Get details on a single comment.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
String id = "id_example"; // String | ID
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
String branch = "my-feature-branch"; // String | specify the branch to use
try {
Comment result = apiInstance.commentShow(projectId, keyId, id, xPhraseAppOTP, branch);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentShow");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
id | String | ID | |
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
branch | String | specify the branch to use | [optional] |
- Content-Type: Not defined
- Accept: application/json
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 - |
Comment commentUpdate(projectId, keyId, id, commentUpdateParameters, xPhraseAppOTP)
Update a comment
Update an existing comment.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
String id = "id_example"; // String | ID
CommentUpdateParameters commentUpdateParameters = new CommentUpdateParameters(); // CommentUpdateParameters |
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
try {
Comment result = apiInstance.commentUpdate(projectId, keyId, id, commentUpdateParameters, xPhraseAppOTP);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentUpdate");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
id | String | ID | |
commentUpdateParameters | CommentUpdateParameters | ||
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
- Content-Type: application/json
- Accept: application/json
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 - |
List<Comment> commentsList(projectId, keyId, commentsListParameters, xPhraseAppOTP, page, perPage, branch, query, localeIds, filters, order)
List comments
List all comments for a key.
// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.CommentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.phrase.com/v2");
// Configure HTTP basic authorization: Basic
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
Basic.setUsername("YOUR USERNAME");
Basic.setPassword("YOUR PASSWORD");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
Token.setApiKeyPrefix("token");
CommentsApi apiInstance = new CommentsApi(defaultClient);
String projectId = "projectId_example"; // String | Project ID
String keyId = "keyId_example"; // String | Translation Key ID
CommentsListParameters commentsListParameters = new CommentsListParameters(); // CommentsListParameters |
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
Integer page = 1; // Integer | Page number
Integer perPage = 25; // Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
String branch = "my-feature-branch"; // String | specify the branch to use
String query = "Some comment content"; // String | Search query for comment messages
List<String> localeIds = Arrays.asList(); // List<String> | Search comments by their assigned locales
List<String> filters = Arrays.asList(); // List<String> | Specify the filter for the comments
String order = "desc"; // String | Order direction. Can be one of: asc, desc.
try {
List<Comment> result = apiInstance.commentsList(projectId, keyId, commentsListParameters, xPhraseAppOTP, page, perPage, branch, query, localeIds, filters, order);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CommentsApi#commentsList");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | String | Project ID | |
keyId | String | Translation Key ID | |
commentsListParameters | CommentsListParameters | ||
xPhraseAppOTP | String | Two-Factor-Authentication token (optional) | [optional] |
page | Integer | Page number | [optional] |
perPage | 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] |
localeIds | List<String> | Search comments by their assigned locales | [optional] |
filters | List<String> | Specify the filter for the comments | [optional] |
order | String | Order direction. Can be one of: asc, desc. | [optional] |
- Content-Type: application/json
- Accept: application/json
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 - |