# REST API Reference

To get started, follow our documentation and POST your content for translation. You can continuously translate your content and GET your translations precisely when you need them. The usage of the API is free.

{% hint style="info" %}
To [obtain your token](https://docs.transiyzi.com/developers/obtaining-api-token), go to your profile settings and click on the "Access Tokens" section. Create a new token there and use it to access the API.
{% endhint %}

### API Endpoints

## Export Languages

<mark style="color:blue;">`GET`</mark> `https://transiyzi.com/api/v1/export/locale`

It exports your translations in the file format that you specify.

#### Headers

| Name                                            | Type   | Description                 |
| ----------------------------------------------- | ------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: YOUR\_ACCESS\_TOKEN |

#### Request Body

| Name                                          | Type    | Description                                                                                                                                                                               |
| --------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark> | UUID    | Your project ID. It can be found in the project settings.                                                                                                                                 |
| locale                                        | String  | If left blank, all project languages will be exported. The selection must be made from your project's languages, and the parameter must be sent in ISO-code format: en, en-US, tr, tr-TR. |
| format                                        | String  | The language files are exported in the specified format here.                                                                                                                             |
| default\_format                               | String  | Default: JSON. The keys that are not associated with a file are exported in this format.                                                                                                  |
| include\_unreviewed\_translations             | Boolean | Default: false. If true is sent, translations that have not yet been approved will be included in the export.                                                                             |

## Import Languages

<mark style="color:green;">`POST`</mark> `https://transiyzi.com/api/v1/import/locale`

It is used to import existing translation files.

#### Headers

| Name                                            | Type   | Description                 |
| ----------------------------------------------- | ------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: YOUR\_ACCESS\_TOKEN |

#### Request Body

| Name                                          | Type    | Description                                                                                                                                                                                                            |
| --------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark> | UUID    | Your project ID. It can be found in the project settings.                                                                                                                                                              |
| file<mark style="color:red;">\*</mark>        | String  | The translation file to be imported.                                                                                                                                                                                   |
| file\_name                                    | String  | The name and path of the file to be imported can be specified together. If not specified, the name of the uploaded file is used. For example: %LANG\_ISO%.php, test/test.json, vendor/nova/%LANG\_ISO%/validation.php. |
| locale<mark style="color:red;">\*</mark>      | String  | The language of the file you want to import can be specified here.                                                                                                                                                     |
| update\_translations                          | Boolean | Default: false. When set to true, existing translations for keys will be updated with the translations from the imported file.                                                                                         |

## List Projects

<mark style="color:blue;">`GET`</mark> `https://transiyzi.com/api/v1/projects`

It lists your projects.

#### Headers

| Name                                            | Type   | Description                 |
| ----------------------------------------------- | ------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: YOUR\_ACCESS\_TOKEN |

## List Languages

<mark style="color:blue;">`GET`</mark> `https://transiyzi.com/api/v1/projects/languages`

It fetches the languages of the specified project. It can also be used to get their ISO codes.

#### Headers

| Name                                            | Type   | Description                 |
| ----------------------------------------------- | ------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: YOUR\_ACCESS\_TOKEN |

#### Request Body

| Name                                          | Type | Description                                               |
| --------------------------------------------- | ---- | --------------------------------------------------------- |
| project\_id<mark style="color:red;">\*</mark> | UUID | Your project ID. It can be found in the project settings. |

## List File Formats

<mark style="color:blue;">`GET`</mark> `https://transiyzi.com/api/v1/file-types`

It can be used to list the formats that can be used in the export endpoint. The 'key' field in the response should be used.

#### Headers

| Name                                            | Type   | Description                 |
| ----------------------------------------------- | ------ | --------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer: YOUR\_ACCESS\_TOKEN |
