Skip to content

Latest commit

 

History

History
792 lines (579 loc) · 36.3 KB

KeysApi.md

File metadata and controls

792 lines (579 loc) · 36.3 KB

phrase_api.KeysApi

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

Method HTTP request Description
key_create POST /projects/{project_id}/keys Create a key
key_delete DELETE /projects/{project_id}/keys/{id} Delete a key
key_show GET /projects/{project_id}/keys/{id} Get a single key
key_update PATCH /projects/{project_id}/keys/{id} Update a key
keys_delete_collection DELETE /projects/{project_id}/keys Delete collection of keys
keys_exclude PATCH /projects/{project_id}/keys/exclude Exclude a locale on a collection of keys
keys_include PATCH /projects/{project_id}/keys/include Include a locale on a collection of keys
keys_list GET /projects/{project_id}/keys List keys
keys_search POST /projects/{project_id}/keys/search Search keys
keys_tag PATCH /projects/{project_id}/keys/tag Add tags to collection of keys
keys_untag PATCH /projects/{project_id}/keys/untag Remove tags from collection of keys

key_create

TranslationKeyDetails key_create(project_id, key_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Create a key

Create a new 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.KeysApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_create_parameters = phrase_api.KeyCreateParameters() # KeyCreateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Create a key
        api_response = api_instance.key_create(project_id, key_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->key_create: %s\n" % e)

Parameters

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

Return type

TranslationKeyDetails

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]

key_delete

key_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Delete a key

Delete an existing 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.KeysApi(api_client)
    project_id = 'project_id_example' # str | Project 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 key
        api_instance.key_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
    except ApiException as e:
        print("Exception when calling KeysApi->key_delete: %s\n" % e)

Parameters

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

key_show

TranslationKeyDetails key_show(project_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Get a single key

Get details on a single key 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.KeysApi(api_client)
    project_id = 'project_id_example' # str | Project 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 key
        api_response = api_instance.key_show(project_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->key_show: %s\n" % e)

Parameters

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

TranslationKeyDetails

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]

key_update

TranslationKeyDetails key_update(project_id, id, key_update_parameters, x_phrase_app_otp=x_phrase_app_otp)

Update a key

Update an existing 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.KeysApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    id = 'id_example' # str | ID (required)
    key_update_parameters = phrase_api.KeyUpdateParameters() # KeyUpdateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Update a key
        api_response = api_instance.key_update(project_id, id, key_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->key_update: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
id str ID
key_update_parameters KeyUpdateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

TranslationKeyDetails

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]

keys_delete_collection

AffectedResources keys_delete_collection(project_id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, q=q, locale_id=locale_id)

Delete collection of keys

Delete all keys matching query. Same constraints as list. Please limit the number of affected keys to about 1,000 as you might experience timeouts otherwise.

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.KeysApi(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)
    branch = 'my-feature-branch' # str | specify the branch to use
    q = 'mykey* translated:true' # str | Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul>   <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li>   <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons  need to be escaped with double backslashes</li>   <li><code>tags:tag_name</code> to filter for keys with certain tags</li>   <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li>   <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li>   <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> <br/> <p><strong>Caution:</strong> Query parameters with empty values will be treated as though they are not included in the request and will be ignored.</p> <br/> Find more examples <a href=\"#overview--usage-examples\">here</a>. 
    locale_id = 'abcd1234abcd1234abcd1234abcd1234' # str | Locale used to determine the translation state of a key when filtering for untranslated or translated keys.

    try:
        # Delete collection of keys
        api_response = api_instance.keys_delete_collection(project_id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, q=q, locale_id=locale_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->keys_delete_collection: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]
branch str specify the branch to use [optional]
q str Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=
locale_id str Locale used to determine the translation state of a key when filtering for untranslated or translated keys. [optional]

Return type

AffectedResources

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]

keys_exclude

AffectedResources keys_exclude(project_id, keys_exclude_parameters, x_phrase_app_otp=x_phrase_app_otp)

Exclude a locale on a collection of keys

Exclude a locale on keys matching query. Same constraints as list.

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

    try:
        # Exclude a locale on a collection of keys
        api_response = api_instance.keys_exclude(project_id, keys_exclude_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->keys_exclude: %s\n" % e)

Parameters

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

Return type

AffectedResources

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]

keys_include

AffectedResources keys_include(project_id, keys_include_parameters, x_phrase_app_otp=x_phrase_app_otp)

Include a locale on a collection of keys

Include a locale on keys matching query. Same constraints as list.

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

    try:
        # Include a locale on a collection of keys
        api_response = api_instance.keys_include(project_id, keys_include_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->keys_include: %s\n" % e)

Parameters

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

Return type

AffectedResources

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]

keys_list

List[TranslationKey] keys_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch, sort=sort, order=order, q=q, locale_id=locale_id)

List keys

List all keys for the given project. Alternatively you can POST requests to /search.

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.KeysApi(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
    branch = 'my-feature-branch' # str | specify the branch to use
    sort = 'updated_at' # str | Sort by field. Can be one of: name, created_at, updated_at.
    order = 'desc' # str | Order direction. Can be one of: asc, desc.
    q = 'mykey* translated:true' # str | Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul>   <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li>   <li><code>name:key_name,...</code> for text queries on a comma-seperated list of exact key names - spaces, commas, and colons need to be escaped with double backslashes</li>   <li><code>tags:tag_name,...</code> to filter for keys with certain comma-seperated list of tags</li>   <li><code>uploads:upload_id,...</code> to filter for keys with certain comma-seperated list of uploads</li>   <li><code>job:{true|false}</code> to filter for keys mentioned in an active job</li>   <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li>   <li><code>updated_at:{&gt;=|&lt;=}2013-02-21T00:00:00Z</code> for date range queries</li>   <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>. 
    locale_id = 'abcd1234abcd1234abcd1234abcd1234' # str | Locale used to determine the translation state of a key when filtering for untranslated or translated keys.

    try:
        # List keys
        api_response = api_instance.keys_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch, sort=sort, order=order, q=q, locale_id=locale_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->keys_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]
branch str specify the branch to use [optional]
sort str Sort by field. Can be one of: name, created_at, updated_at. [optional]
order str Order direction. Can be one of: asc, desc. [optional]
q str Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name,...</code> for text queries on a comma-seperated list of exact key names - spaces, commas, and colons need to be escaped with double backslashes</li> <li><code>tags:tag_name,...</code> to filter for keys with certain comma-seperated list of tags</li> <li><code>uploads:upload_id,...</code> to filter for keys with certain comma-seperated list of uploads</li> <li><code>job:{true false}</code> to filter for keys mentioned in an active job</li> <li><code>translated:{true
locale_id str Locale used to determine the translation state of a key when filtering for untranslated or translated keys. [optional]

Return type

List[TranslationKey]

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]

keys_search

List[TranslationKey] keys_search(project_id, keys_search_parameters, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page)

Search keys

Search keys for the given project matching query.

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.KeysApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    keys_search_parameters = phrase_api.KeysSearchParameters() # KeysSearchParameters |  (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

    try:
        # Search keys
        api_response = api_instance.keys_search(project_id, keys_search_parameters, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->keys_search: %s\n" % e)

Parameters

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

Return type

List[TranslationKey]

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

keys_tag

AffectedResources keys_tag(project_id, keys_tag_parameters, x_phrase_app_otp=x_phrase_app_otp)

Add tags to collection of keys

Tags all keys matching query. Same constraints as list.

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

    try:
        # Add tags to collection of keys
        api_response = api_instance.keys_tag(project_id, keys_tag_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->keys_tag: %s\n" % e)

Parameters

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

Return type

AffectedResources

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]

keys_untag

AffectedResources keys_untag(project_id, keys_untag_parameters, x_phrase_app_otp=x_phrase_app_otp)

Remove tags from collection of keys

Removes specified tags from keys matching query.

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

    try:
        # Remove tags from collection of keys
        api_response = api_instance.keys_untag(project_id, keys_untag_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling KeysApi->keys_untag: %s\n" % e)

Parameters

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

Return type

AffectedResources

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]