Skip to content

Latest commit

 

History

History
295 lines (215 loc) · 11.4 KB

File metadata and controls

295 lines (215 loc) · 11.4 KB

phrase_api.TagsApi

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

Method HTTP request Description
tag_create POST /projects/{project_id}/tags Create a tag
tag_delete DELETE /projects/{project_id}/tags/{name} Delete a tag
tag_show GET /projects/{project_id}/tags/{name} Get a single tag
tags_list GET /projects/{project_id}/tags List tags

tag_create

TagWithStats tag_create(project_id, tag_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Create a tag

Create a new tag.

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.TagsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    tag_create_parameters = phrase_api.TagCreateParameters() # TagCreateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Create a tag
        api_response = api_instance.tag_create(project_id, tag_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TagsApi->tag_create: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
tag_create_parameters TagCreateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

TagWithStats

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]

tag_delete

tag_delete(project_id, name, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Delete a tag

Delete an existing tag.

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.TagsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    name = 'name_example' # str | name (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 tag
        api_instance.tag_delete(project_id, name, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
    except ApiException as e:
        print("Exception when calling TagsApi->tag_delete: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
name str name
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]

tag_show

TagWithStats tag_show(project_id, name, x_phrase_app_otp=x_phrase_app_otp, omit_statistics=omit_statistics, branch=branch)

Get a single tag

Get details and progress information on a single tag for a given project.

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.TagsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    name = 'name_example' # str | name (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    omit_statistics = true # bool | omit statistics in the response
    branch = 'my-feature-branch' # str | specify the branch to use

    try:
        # Get a single tag
        api_response = api_instance.tag_show(project_id, name, x_phrase_app_otp=x_phrase_app_otp, omit_statistics=omit_statistics, branch=branch)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TagsApi->tag_show: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
name str name
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]
omit_statistics bool omit statistics in the response [optional]
branch str specify the branch to use [optional]

Return type

TagWithStats

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]

tags_list

List[Tag] tags_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, exclude_system_tags=exclude_system_tags, branch=branch)

List tags

List all tags for the given project.

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.TagsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (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
    exclude_system_tags = true # bool | excludes tags generated by the system, e.g. job, upload or figma tags
    branch = 'my-feature-branch' # str | specify the branch to use

    try:
        # List tags
        api_response = api_instance.tags_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, exclude_system_tags=exclude_system_tags, branch=branch)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TagsApi->tags_list: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
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]
exclude_system_tags bool excludes tags generated by the system, e.g. job, upload or figma tags [optional]
branch str specify the branch to use [optional]

Return type

List[Tag]

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 -
* 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]