100% of the API is implemented as a GraphQL API. But to ensure that integration with common tools such as curl
is simple, we also provide a basic HTTP API for the most used operations:
POST /sync
project_id
file
language
document_format
document_path
OK 200
– The sync succeededNot found 404
– Unknown projectUnprocessable entity 422
– Missing/invalid paramsPOST /add-translations
project_id
file
language
document_format
document_path
merge_type
(smart, passive or force, default to smart)OK 200
– The merge succeededNot found 404
– Unknown projectUnprocessable entity 422
– Missing/invalid paramsThe API offers a way to preview operations.
By adding /peek
to POST /sync
and POST /add-translations
, the operation will not "commit" and the response will be
a series of activity.
POST /sync/peek
POST /add-translations/peek
{
"data": {
"stats": {
"e8b4bdf8-dc21-4af9-a017-aae4b4cb04eb": {
"conflict_on_proposed": 1
}
},
"operations": {
"e8b4bdf8-dc21-4af9-a017-aae4b4cb04eb": [{
"text": "Foo",
"previous-text": "Bar",
"key": "general.application.name",
"action": "conflict_on_proposed"
}]
}
}
}
language_id
document_format
document_path
order_by
(index or key-asc, default to index)OK 200
Not found 404
– Unknown project, language, format…$ curl "export/?project_id=project-uuid&language=en&document_format=strings&document_path=Localization.strings"
Deploy Accent and start translating your project!