Import files

post
Upload data

https://api.simplelocalize.io/api/v1/files
This endpoint imports translations and i18n keys from Excel file.
Request
Response
Request
Headers
Content-Type
required
string
Always: 'multipart/form-data'
X-SimpleLocalize-Token
required
string
Project Upload Token from Settings tab
Query Parameters
importOptions
optional
string
Check import options below.
Form Data Parameters
file
required
object
File to import
Response
200: OK
Success
{
"msg": "OK",
"status": 200
}

Example curl request:

curl --request POST \
--url https://api.simplelocalize.io/api/v1/files?importOptions=REPLACE_TRANSLATION_IF_FOUND&importOptions=PUBLISH_AFTER_IMPORT \
--header 'content-type: multipart/form-data; boundary=<BOUNDARY>' \
--header 'x-simplelocalize-token: <YOUR_PROJECT_UPLOAD_TOKEN>' \
--form file=

Import options

Use query param importOptions to do invoke custom logic after or during the import.You can pass more than one import option. If you need more import options let us know: [email protected]

importOption value

Feature description

REPLACE_TRANSLATION_IF_FOUND

Replaces translation for key if the key already exists. Without this option SimpleLocalize will only add new translations.

PUBLISH_AFTER_IMPORT

Translations will be published automatically to the CDN after successful import.