Skip to content

Latest commit

 

History

History
426 lines (337 loc) · 16.8 KB

GlossaryTermsApi.md

File metadata and controls

426 lines (337 loc) · 16.8 KB

GlossaryTermsApi

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

Method HTTP request Description
glossaryTermCreate POST /accounts/{account_id}/glossaries/{glossary_id}/terms Create a term
glossaryTermDelete DELETE /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} Delete a term
glossaryTermShow GET /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} Get a single term
glossaryTermUpdate PATCH /accounts/{account_id}/glossaries/{glossary_id}/terms/{id} Update a term
glossaryTermsList GET /accounts/{account_id}/glossaries/{glossary_id}/terms List terms

glossaryTermCreate

GlossaryTerm glossaryTermCreate(accountId, glossaryId, glossaryTermCreateParameters, xPhraseAppOTP)

Create a term

Create a new term in a term base (previously: glossary).

Example

// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.GlossaryTermsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.phrase.com/v2");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    // Configure API key authorization: Token
    ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
    Token.setApiKey("YOUR API KEY");
    Token.setApiKeyPrefix("token");

    GlossaryTermsApi apiInstance = new GlossaryTermsApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String glossaryId = "glossaryId_example"; // String | Glossary ID
    GlossaryTermCreateParameters glossaryTermCreateParameters = new GlossaryTermCreateParameters(); // GlossaryTermCreateParameters | 
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      GlossaryTerm result = apiInstance.glossaryTermCreate(accountId, glossaryId, glossaryTermCreateParameters, xPhraseAppOTP);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossaryTermsApi#glossaryTermCreate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
accountId String Account ID
glossaryId String Glossary ID
glossaryTermCreateParameters GlossaryTermCreateParameters
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]

Return type

GlossaryTerm

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 -

glossaryTermDelete

glossaryTermDelete(accountId, glossaryId, id, xPhraseAppOTP)

Delete a term

Delete an existing term in a term base (previously: glossary).

Example

// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.GlossaryTermsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.phrase.com/v2");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    // Configure API key authorization: Token
    ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
    Token.setApiKey("YOUR API KEY");
    Token.setApiKeyPrefix("token");

    GlossaryTermsApi apiInstance = new GlossaryTermsApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String glossaryId = "glossaryId_example"; // String | Glossary ID
    String id = "id_example"; // String | ID
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      apiInstance.glossaryTermDelete(accountId, glossaryId, id, xPhraseAppOTP);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossaryTermsApi#glossaryTermDelete");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
accountId String Account ID
glossaryId String Glossary ID
id String ID
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]

Return type

null (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 -

glossaryTermShow

GlossaryTerm glossaryTermShow(accountId, glossaryId, id, xPhraseAppOTP)

Get a single term

Get details for a single term in the term base (previously: glossary).

Example

// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.GlossaryTermsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.phrase.com/v2");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    // Configure API key authorization: Token
    ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
    Token.setApiKey("YOUR API KEY");
    Token.setApiKeyPrefix("token");

    GlossaryTermsApi apiInstance = new GlossaryTermsApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String glossaryId = "glossaryId_example"; // String | Glossary ID
    String id = "id_example"; // String | ID
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      GlossaryTerm result = apiInstance.glossaryTermShow(accountId, glossaryId, id, xPhraseAppOTP);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossaryTermsApi#glossaryTermShow");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
accountId String Account ID
glossaryId String Glossary ID
id String ID
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]

Return type

GlossaryTerm

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 -

glossaryTermUpdate

GlossaryTerm glossaryTermUpdate(accountId, glossaryId, id, glossaryTermUpdateParameters, xPhraseAppOTP)

Update a term

Update an existing term in a term base (previously: glossary).

Example

// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.GlossaryTermsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.phrase.com/v2");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    // Configure API key authorization: Token
    ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
    Token.setApiKey("YOUR API KEY");
    Token.setApiKeyPrefix("token");

    GlossaryTermsApi apiInstance = new GlossaryTermsApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String glossaryId = "glossaryId_example"; // String | Glossary ID
    String id = "id_example"; // String | ID
    GlossaryTermUpdateParameters glossaryTermUpdateParameters = new GlossaryTermUpdateParameters(); // GlossaryTermUpdateParameters | 
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      GlossaryTerm result = apiInstance.glossaryTermUpdate(accountId, glossaryId, id, glossaryTermUpdateParameters, xPhraseAppOTP);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossaryTermsApi#glossaryTermUpdate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
accountId String Account ID
glossaryId String Glossary ID
id String ID
glossaryTermUpdateParameters GlossaryTermUpdateParameters
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]

Return type

GlossaryTerm

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 -

glossaryTermsList

List<GlossaryTerm> glossaryTermsList(accountId, glossaryId, xPhraseAppOTP, page, perPage)

List terms

List all terms in term bases (previously: glossary) that the current user has access to.

Example

// Import classes:
import com.phrase.client.ApiClient;
import com.phrase.client.ApiException;
import com.phrase.client.Configuration;
import com.phrase.client.auth.*;
import com.phrase.client.models.*;
import com.phrase.client.api.GlossaryTermsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.phrase.com/v2");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    // Configure API key authorization: Token
    ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
    Token.setApiKey("YOUR API KEY");
    Token.setApiKeyPrefix("token");

    GlossaryTermsApi apiInstance = new GlossaryTermsApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String glossaryId = "glossaryId_example"; // String | Glossary ID
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    Integer page = 1; // Integer | Page number
    Integer perPage = 25; // Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
    try {
      List<GlossaryTerm> result = apiInstance.glossaryTermsList(accountId, glossaryId, xPhraseAppOTP, page, perPage);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossaryTermsApi#glossaryTermsList");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
accountId String Account ID
glossaryId String Glossary ID
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]
page Integer Page number [optional]
perPage Integer Limit on the number of objects to be returned, between 1 and 100. 25 by default [optional]

Return type

List<GlossaryTerm>

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 -