Skip to content

Latest commit

 

History

History
367 lines (268 loc) · 15.8 KB

CustomMetadataApi.md

File metadata and controls

367 lines (268 loc) · 15.8 KB

phrase_api.CustomMetadataApi

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

Method HTTP request Description
custom_metadata_properties_delete DELETE /accounts/{account_id}/custom_metadata/properties/{id} Destroy property
custom_metadata_properties_list GET /accounts/{account_id}/custom_metadata/properties List properties
custom_metadata_property_create POST /accounts/{account_id}/custom_metadata/properties Create a property
custom_metadata_property_show GET /accounts/{account_id}/custom_metadata/properties/{id} Get a single property
custom_metadata_property_update PATCH /accounts/{account_id}/custom_metadata/properties/{id} Update a property

custom_metadata_properties_delete

custom_metadata_properties_delete(account_id, id, x_phrase_app_otp=x_phrase_app_otp)

Destroy property

Destroy a custom metadata property of an account. This endpoint is only available to accounts with advanced plans or above.

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.CustomMetadataApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Destroy property
        api_instance.custom_metadata_properties_delete(account_id, id, x_phrase_app_otp=x_phrase_app_otp)
    except ApiException as e:
        print("Exception when calling CustomMetadataApi->custom_metadata_properties_delete: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
id str ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [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]

custom_metadata_properties_list

List[CustomMetadataProperty] custom_metadata_properties_list(account_id, x_phrase_app_otp=x_phrase_app_otp, data_type=data_type, project_id=project_id, page=page, per_page=per_page, q=q, sort=sort, order=order)

List properties

List all custom metadata properties for an account. This endpoint is only available to accounts with advanced plans or above.

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.CustomMetadataApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    data_type = phrase_api.CustomMetadataDataType() # CustomMetadataDataType | Data Type of Custom Metadata Property
    project_id = 'abcd1234cdef1234abcd1234cdef1234' # str | id of project that the properties belong to
    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
    q = 'character_name' # str | query to find a property by name
    sort = 'updated_at' # str | Sort criteria. Can be one of: name, data_type, created_at.
    order = 'desc' # str | Order direction. Can be one of: asc, desc.

    try:
        # List properties
        api_response = api_instance.custom_metadata_properties_list(account_id, x_phrase_app_otp=x_phrase_app_otp, data_type=data_type, project_id=project_id, page=page, per_page=per_page, q=q, sort=sort, order=order)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CustomMetadataApi->custom_metadata_properties_list: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]
data_type CustomMetadataDataType Data Type of Custom Metadata Property [optional]
project_id str id of project that the properties belong to [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]
q str query to find a property by name [optional]
sort str Sort criteria. Can be one of: name, data_type, created_at. [optional]
order str Order direction. Can be one of: asc, desc. [optional]

Return type

List[CustomMetadataProperty]

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]

custom_metadata_property_create

CustomMetadataProperty custom_metadata_property_create(account_id, custom_metadata_properties_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Create a property

Create a new custom metadata property.

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.CustomMetadataApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    custom_metadata_properties_create_parameters = phrase_api.CustomMetadataPropertiesCreateParameters() # CustomMetadataPropertiesCreateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Create a property
        api_response = api_instance.custom_metadata_property_create(account_id, custom_metadata_properties_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CustomMetadataApi->custom_metadata_property_create: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
custom_metadata_properties_create_parameters CustomMetadataPropertiesCreateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

CustomMetadataProperty

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 -
422 Unprocessable entity * 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]

custom_metadata_property_show

CustomMetadataProperty custom_metadata_property_show(account_id, id, x_phrase_app_otp=x_phrase_app_otp)

Get a single property

Get details of a single custom property.

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.CustomMetadataApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    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 property
        api_response = api_instance.custom_metadata_property_show(account_id, id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CustomMetadataApi->custom_metadata_property_show: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
id str ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

CustomMetadataProperty

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]

custom_metadata_property_update

CustomMetadataProperty custom_metadata_property_update(account_id, id, custom_metadata_properties_update_parameters, x_phrase_app_otp=x_phrase_app_otp)

Update a property

Update an existing custom metadata property.

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.CustomMetadataApi(api_client)
    account_id = 'account_id_example' # str | Account ID (required)
    id = 'id_example' # str | ID (required)
    custom_metadata_properties_update_parameters = phrase_api.CustomMetadataPropertiesUpdateParameters() # CustomMetadataPropertiesUpdateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Update a property
        api_response = api_instance.custom_metadata_property_update(account_id, id, custom_metadata_properties_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CustomMetadataApi->custom_metadata_property_update: %s\n" % e)

Parameters

Name Type Description Notes
account_id str Account ID
id str ID
custom_metadata_properties_update_parameters CustomMetadataPropertiesUpdateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

CustomMetadataProperty

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]