All URIs are relative to https://api.phrase.com/v2
Method | HTTP request | Description |
---|---|---|
project_create | POST /projects | Create a project |
project_delete | DELETE /projects/{id} | Delete a project |
project_show | GET /projects/{id} | Get a single project |
project_update | PATCH /projects/{id} | Update a project |
projects_list | GET /projects | List projects |
ProjectDetails project_create(project_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
Create a project
Create a new project.
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.ProjectsApi(api_client)
project_create_parameters = phrase_api.ProjectCreateParameters() # ProjectCreateParameters | (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Create a project
api_response = api_instance.project_create(project_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectsApi->project_create: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_create_parameters | ProjectCreateParameters | ||
x_phrase_app_otp | str | 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 - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
project_delete(id, x_phrase_app_otp=x_phrase_app_otp)
Delete a project
Delete an existing project.
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.ProjectsApi(api_client)
id = 'id_example' # str | ID (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Delete a project
api_instance.project_delete(id, x_phrase_app_otp=x_phrase_app_otp)
except ApiException as e:
print("Exception when calling ProjectsApi->project_delete: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ID | |
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [optional] |
void (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 - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProjectDetails project_show(id, x_phrase_app_otp=x_phrase_app_otp)
Get a single project
Get details on a single project.
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.ProjectsApi(api_client)
id = 'id_example' # str | ID (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Get a single project
api_response = api_instance.project_show(id, x_phrase_app_otp=x_phrase_app_otp)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectsApi->project_show: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ID | |
x_phrase_app_otp | str | Two-Factor-Authentication token (optional) | [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 - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProjectDetails project_update(id, project_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
Update a project
Update an existing project.
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.ProjectsApi(api_client)
id = 'id_example' # str | ID (required)
project_update_parameters = phrase_api.ProjectUpdateParameters() # ProjectUpdateParameters | (required)
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
try:
# Update a project
api_response = api_instance.project_update(id, project_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectsApi->project_update: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | ID | |
project_update_parameters | ProjectUpdateParameters | ||
x_phrase_app_otp | str | 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 - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List[Project] projects_list(x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, account_id=account_id, sort_by=sort_by, filters=filters)
List projects
List all projects the current user has access to.
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.ProjectsApi(api_client)
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
account_id = 'account_id_example' # str | Filter by Account ID
sort_by = 'sort_by_example' # str | Sort projects. Valid options are \"name_asc\", \"name_desc\", \"updated_at_asc\", \"updated_at_desc\", \"space_asc\" and \"space_desc\".
filters = ['favorites'] # List[str] | Filter projects. Valid options are [\"favorites\"].
try:
# List projects
api_response = api_instance.projects_list(x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, account_id=account_id, sort_by=sort_by, filters=filters)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectsApi->projects_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
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] |
account_id | str | Filter by Account ID | [optional] |
sort_by | str | Sort projects. Valid options are "name_asc", "name_desc", "updated_at_asc", "updated_at_desc", "space_asc" and "space_desc". | [optional] |
filters | List[str] | Filter projects. Valid options are ["favorites"]. | [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 - * 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]