Skip to content

Latest commit

 

History

History
79 lines (59 loc) · 2.27 KB

FormatsApi.md

File metadata and controls

79 lines (59 loc) · 2.27 KB

FormatsApi

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

Method HTTP request Description
formatsList GET /formats List formats

formatsList

List<Format> formatsList()

List formats

Get a handy list of all localization file formats supported in Phrase.

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.FormatsApi;

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");

    FormatsApi apiInstance = new FormatsApi(defaultClient);
    try {
      List<Format> result = apiInstance.formatsList();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FormatsApi#formatsList");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

List<Format>

Authorization

Basic, Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Bad request * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -