Skip to content

Latest commit

 

History

History
421 lines (332 loc) · 16 KB

GlossariesApi.md

File metadata and controls

421 lines (332 loc) · 16 KB

GlossariesApi

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

Method HTTP request Description
glossariesList GET /accounts/{account_id}/glossaries List glossaries
glossaryCreate POST /accounts/{account_id}/glossaries Create a glossary
glossaryDelete DELETE /accounts/{account_id}/glossaries/{id} Delete a glossary
glossaryShow GET /accounts/{account_id}/glossaries/{id} Get a single glossary
glossaryUpdate PATCH /accounts/{account_id}/glossaries/{id} Update a glossary

glossariesList

List<Glossary> glossariesList(accountId, xPhraseAppOTP, page, perPage)

List glossaries

List all glossaries 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.GlossariesApi;

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");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //Token.setApiKeyPrefix("Token");

    GlossariesApi apiInstance = new GlossariesApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    Integer page = 1; // Integer | Page number
    Integer perPage = 25; // Integer | allows you to specify a page size up to 100 items, 25 by default
    try {
      List<Glossary> result = apiInstance.glossariesList(accountId, xPhraseAppOTP, page, perPage);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossariesApi#glossariesList");
      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
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]
page Integer Page number [optional]
perPage Integer allows you to specify a page size up to 100 items, 25 by default [optional]

Return type

List<Glossary>

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

glossaryCreate

Glossary glossaryCreate(accountId, glossaryCreateParameters, xPhraseAppOTP)

Create a glossary

Create a new 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.GlossariesApi;

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");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //Token.setApiKeyPrefix("Token");

    GlossariesApi apiInstance = new GlossariesApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    GlossaryCreateParameters glossaryCreateParameters = new GlossaryCreateParameters(); // GlossaryCreateParameters | 
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      Glossary result = apiInstance.glossaryCreate(accountId, glossaryCreateParameters, xPhraseAppOTP);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossariesApi#glossaryCreate");
      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
glossaryCreateParameters GlossaryCreateParameters
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]

Return type

Glossary

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 -

glossaryDelete

glossaryDelete(accountId, id, xPhraseAppOTP)

Delete a glossary

Delete an existing 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.GlossariesApi;

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");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //Token.setApiKeyPrefix("Token");

    GlossariesApi apiInstance = new GlossariesApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String id = "id_example"; // String | ID
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      apiInstance.glossaryDelete(accountId, id, xPhraseAppOTP);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossariesApi#glossaryDelete");
      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
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 -

glossaryShow

Glossary glossaryShow(accountId, id, xPhraseAppOTP)

Get a single glossary

Get details on a single 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.GlossariesApi;

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");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //Token.setApiKeyPrefix("Token");

    GlossariesApi apiInstance = new GlossariesApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String id = "id_example"; // String | ID
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      Glossary result = apiInstance.glossaryShow(accountId, id, xPhraseAppOTP);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossariesApi#glossaryShow");
      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
id String ID
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]

Return type

Glossary

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 -

glossaryUpdate

Glossary glossaryUpdate(accountId, id, glossaryUpdateParameters, xPhraseAppOTP)

Update a glossary

Update an existing 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.GlossariesApi;

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");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //Token.setApiKeyPrefix("Token");

    GlossariesApi apiInstance = new GlossariesApi(defaultClient);
    String accountId = "accountId_example"; // String | Account ID
    String id = "id_example"; // String | ID
    GlossaryUpdateParameters glossaryUpdateParameters = new GlossaryUpdateParameters(); // GlossaryUpdateParameters | 
    String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
    try {
      Glossary result = apiInstance.glossaryUpdate(accountId, id, glossaryUpdateParameters, xPhraseAppOTP);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GlossariesApi#glossaryUpdate");
      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
id String ID
glossaryUpdateParameters GlossaryUpdateParameters
xPhraseAppOTP String Two-Factor-Authentication token (optional) [optional]

Return type

Glossary

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 -