API
Authorisation
When making requests to the LocaliseFox REST API you can authorise by supplying a value for the Authorization header like so:
Authorization: Bearer <API_KEY>
Where <API_KEY> is the API key found on the API page for your project.
Endpoints
All endpoints expect the payload to be delivered via JSON.
Your Project ID can be found on the API page for your project
Import Keys
Conveniently import a set of keys for a particular language. If the key doesn't already exist, one will be created. The supplied translation and optional description will overwrite any other previously supplied translation or description. Currently, only the formatjs file format is supported. Additional file formats can be added upon request.
POST https://api.localisefox.com/projects/<PROJECT_ID>/keys/import
Request
{
"languages": {
"en-US": {
"format": "formatjs",
"data": {
"example.hello": {
"defaultMessage": "hello, world"
"description": "The classic 'Hello, World!' example"
}
}
}
}
}
The description field is optional and is ideally supplied when uploading translations in the source language.
Note also that you can supply multiple languages. This is useful if you wish to import existing translations from another system
Export Keys
GET https://api.localisefox.com/projects/<PROJECT_ID>/keys/export?format=formatjs
Export a list of keys and all of their non-empty translations across all project languages.
{
"languages": {
"en-US": {
"format": "formatjs",
"data": {
"example.hello": {
"defaultMessage": "hello, world"
}
}
}
"de-DE": {
"format": "formatjs",
"data": {
"example.hello": {
"defaultMessage": "hallo, welt"
}
}
}
}
}