Skip to content

Latest commit

 

History

History
548 lines (314 loc) · 18.9 KB

KeysApi.md

File metadata and controls

548 lines (314 loc) · 18.9 KB

\KeysApi

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

Method HTTP request Description
KeyCreate Post /projects/{project_id}/keys Create a key
KeyDelete Delete /projects/{project_id}/keys/{id} Delete a key
KeyShow Get /projects/{project_id}/keys/{id} Get a single key
KeyUpdate Patch /projects/{project_id}/keys/{id} Update a key
KeysDeleteCollection Delete /projects/{project_id}/keys Delete collection of keys
KeysExclude Patch /projects/{project_id}/keys/exclude Exclude a locale on a collection of keys
KeysInclude Patch /projects/{project_id}/keys/include Include a locale on a collection of keys
KeysList Get /projects/{project_id}/keys List keys
KeysSearch Post /projects/{project_id}/keys/search Search keys
KeysTag Patch /projects/{project_id}/keys/tag Add tags to collection of keys
KeysUntag Patch /projects/{project_id}/keys/untag Remove tags from collection of keys

KeyCreate

TranslationKeyDetails KeyCreate(ctx, projectId, keyCreateParameters, optional)

Create a key

Create a new key.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
keyCreateParameters KeyCreateParameters
optional *KeyCreateOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeyCreateOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) |

Return type

TranslationKeyDetails

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeyDelete

KeyDelete(ctx, projectId, id, optional)

Delete a key

Delete an existing key.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
id string ID
optional *KeyDeleteOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeyDeleteOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) | branch | optional.String| specify the branch to use |

Return type

(empty response body)

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeyShow

TranslationKeyDetails KeyShow(ctx, projectId, id, optional)

Get a single key

Get details on a single key for a given project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
id string ID
optional *KeyShowOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeyShowOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) | branch | optional.String| specify the branch to use |

Return type

TranslationKeyDetails

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeyUpdate

TranslationKeyDetails KeyUpdate(ctx, projectId, id, keyUpdateParameters, optional)

Update a key

Update an existing key.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
id string ID
keyUpdateParameters KeyUpdateParameters
optional *KeyUpdateOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeyUpdateOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) |

Return type

TranslationKeyDetails

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeysDeleteCollection

AffectedResources KeysDeleteCollection(ctx, projectId, optional)

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.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
optional *KeysDeleteCollectionOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeysDeleteCollectionOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) | branch | optional.String| specify the branch to use | q | optional.String| 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=&quot;#overview--usage-examples&quot;>here</a>. | localeId | optional.String| Locale used to determine the translation state of a key when filtering for untranslated or translated keys. |

Return type

AffectedResources

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeysExclude

AffectedResources KeysExclude(ctx, projectId, keysExcludeParameters, optional)

Exclude a locale on a collection of keys

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

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
keysExcludeParameters KeysExcludeParameters
optional *KeysExcludeOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeysExcludeOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) |

Return type

AffectedResources

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeysInclude

AffectedResources KeysInclude(ctx, projectId, keysIncludeParameters, optional)

Include a locale on a collection of keys

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

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
keysIncludeParameters KeysIncludeParameters
optional *KeysIncludeOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeysIncludeOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) |

Return type

AffectedResources

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeysList

[]TranslationKey KeysList(ctx, projectId, optional)

List keys

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

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
optional *KeysListOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeysListOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) | page | optional.Int32| Page number | perPage | optional.Int32| Limit on the number of objects to be returned, between 1 and 100. 25 by default | branch | optional.String| specify the branch to use | sort | optional.String| Sort by field. Can be one of: name, created_at, updated_at. | order | optional.String| Order direction. Can be one of: asc, desc. | q | optional.String| 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=&quot;#overview--usage-examples&quot;>here</a>. | localeId | optional.String| Locale used to determine the translation state of a key when filtering for untranslated or translated keys. |

Return type

[]TranslationKey

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeysSearch

[]TranslationKey KeysSearch(ctx, projectId, keysSearchParameters, optional)

Search keys

Search keys for the given project matching query.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
keysSearchParameters KeysSearchParameters
optional *KeysSearchOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeysSearchOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) | page | optional.Int32| Page number | perPage | optional.Int32| Limit on the number of objects to be returned, between 1 and 100. 25 by default |

Return type

[]TranslationKey

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeysTag

AffectedResources KeysTag(ctx, projectId, keysTagParameters, optional)

Add tags to collection of keys

Tags all keys matching query. Same constraints as list.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
keysTagParameters KeysTagParameters
optional *KeysTagOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeysTagOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) |

Return type

AffectedResources

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

KeysUntag

AffectedResources KeysUntag(ctx, projectId, keysUntagParameters, optional)

Remove tags from collection of keys

Removes specified tags from keys matching query.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectId string Project ID
keysUntagParameters KeysUntagParameters
optional *KeysUntagOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a KeysUntagOpts struct

Name Type Description Notes

xPhraseAppOTP | optional.String| Two-Factor-Authentication token (optional) |

Return type

AffectedResources

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]