### Sync Data Format Example Source: https://poeditor.com/docs/api Example of the JSON structure required for the data parameter. ```json [ { "term": "Add new list", "context": "", "reference": "\/projects", "plural": "", "comment": "" }, { "term": "one project found", "context": "", "reference": "\/projects", "plural": "%d projects found", "comment": "Make sure you translate the plural forms", "tags": [ "first_tag", "second_tag" ] }, { "term": "Show all projects", "context": "", "reference": "\/projects", "plural": "", "tags": "just_a_tag" } ] ``` -------------------------------- ### Export Option Examples Source: https://poeditor.com/docs/api Advanced configuration options for specific file formats. ```text // Android Strings exported without wrapping the strings in quotes. options=[{"unquoted": 1}] // RESX and RESW files exported without encoding single and double quotes. options=[{"unencoded": 1}] // Xcstrings files exported containing all the languages in the project. options=[{"export_all": 1}] ``` -------------------------------- ### Export Filter Examples Source: https://poeditor.com/docs/api Demonstrates how to pass single or multiple filters to the export endpoint. ```text filters=translated filters=["translated"] filters=["translated", "not_fuzzy"] ``` -------------------------------- ### Export Tag Examples Source: https://poeditor.com/docs/api Demonstrates how to pass single or multiple tags to the export endpoint. ```text tags=name-of-tag tags=["name-of-tag"] tags=["name-of-tag", "name-of-another-tag"] ``` -------------------------------- ### Sync Response Example Source: https://poeditor.com/docs/api Successful response structure for the sync operation. ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "terms": { "parsed": 2, "added": 2, "updated": 0, "deleted": 2446 } } } ``` -------------------------------- ### Export Response Example Source: https://poeditor.com/docs/api Successful response containing the temporary download URL. ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "url": "https:\/\/api.poeditor.com\/v2\/download\/file\/b577a66ac39d82995debfabc016f855d" } } ``` -------------------------------- ### API Upload Response Example Source: https://poeditor.com/docs/api This is an example of a successful response when uploading terms to POEditor. It shows the number of terms parsed, added, and deleted. ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "terms": { "parsed": 1017, "added": 1017, "deleted": 0 }, "translations": { "parsed": 0, "added": 0, "updated": 0 } } } ``` -------------------------------- ### POEditor API Project Add Response Source: https://poeditor.com/docs/api Example response when a project is successfully created via the POEditor API. ```json { "response": { "status": "success", "code": "200", "message": "Project created." }, "result": { "project": { "id": 7717, "name": "Automobile", "description": "", "public": 0, "open": 0, "reference_language": "", "fallback_language": "", "terms": 0, "created": "2014-08-13T09:39:32+0000" } } } ``` -------------------------------- ### POEditor API Project Update Response Source: https://poeditor.com/docs/api Example response after successfully updating project settings via the POEditor API. ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "project": { "id": 7717, "name": "Automobile", "description": "", "public": 1, "open": 0, "reference_language": "en", "fallback_language": "fr", "terms": 184, "created": "2014-08-13T09:39:32+0000" } } } ``` -------------------------------- ### Format JSON options parameter Source: https://poeditor.com/docs/api Example of a JSON-formatted string used within the options parameter for specific export configurations. ```json [{"unquoted": 1}] ``` -------------------------------- ### Export project data request Source: https://poeditor.com/docs/api Example of a POST request to export project data, including the options parameter as a JSON string. ```bash curl -X POST https://api.poeditor.com/v2/projects/export \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" \ -d language="fr" \ -d type="android_strings" \ -d fallback_language="en" \ -d options="[{\"unquoted\":1}]" ``` -------------------------------- ### POEditor API Tagging Options Source: https://poeditor.com/docs/api Examples of how to specify tags when uploading to POEditor. Tags can be applied to all terms, new terms, or obsolete terms. ```bash # If not specified, the tags are set by default to all terms. tags=["name-of-tag", "name-of-another-tag"] tags={"all":"name-of-tag"} tags={"all":"name-of-tag","new":["name-of-tag"],"obsolete":["name-of-tag", "name-of-another-tag"]} ``` -------------------------------- ### POEditor API Project Delete Response Source: https://poeditor.com/docs/api Example response when a project is successfully deleted via the POEditor API. ```json { "response": { "status": "success", "code": "200", "message": "Project was deleted: Automobile [7717]" } } ``` -------------------------------- ### Translation Data Example (Singular) Source: https://poeditor.com/docs/api This JSON format is used for providing singular translation data when adding or updating translations. It includes the term, context, and the translated content. ```json [ { "term": "Projects", "context": "project list", "translation": { "content": "Des projets" } } ] ``` -------------------------------- ### Translation Data Example (Plural) Source: https://poeditor.com/docs/api This JSON format is used for providing plural translation data. It supports different forms like 'one' and 'other' for languages with pluralization rules. ```json [ { "term": "%d Projects available", "context": "project list", "translation": { "content": { "one": "Un projet disponible", "other": "%d Projets disponibles" } } } ] ``` -------------------------------- ### POST /v2/projects/add Source: https://poeditor.com/docs/api Creates a new localization project. Returns the project details upon successful creation. ```APIDOC ## POST /v2/projects/add ### Description Creates a new localization project. ### Method POST ### Endpoint https://api.poeditor.com/v2/projects/add ### Parameters #### Request Body - **api_token** (string) - Required - Your POEditor API token. - **name** (string) - Required - The name of the project. - **description** (string) - Optional - The description of the project. ### Request Example ```json { "api_token": "a9824103d8729b923fbe1d268ef9", "name": "Automobile" } ``` ### Response #### Success Response (200) - **response** (object) - Contains status, code, and message. - **result** (object) - Contains project details. - **project** (object) - Details of the created project. - **id** (integer) - The unique identifier for the project. - **name** (string) - The name of the project. - **description** (string) - The description of the project. - **public** (integer) - Indicates if the project is public (1) or private (0). - **open** (integer) - Indicates if the project is open (1) or closed (0). - **reference_language** (string) - The reference language code. - **fallback_language** (string) - The fallback language code. - **terms** (integer) - The number of terms in the project. - **created** (string) - The date and time the project was created. #### Response Example ```json { "response": { "status": "success", "code": "200", "message": "Project created." }, "result": { "project": { "id": 7717, "name": "Automobile", "description": "", "public": 0, "open": 0, "reference_language": "", "fallback_language": "", "terms": 0, "created": "2014-08-13T09:39:32+0000" } } } ``` ``` -------------------------------- ### List projects request and response Source: https://poeditor.com/docs/api Retrieve a list of all localization projects owned by the authenticated user. ```bash curl -X POST https://api.poeditor.com/v2/projects/list \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" ``` ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "projects": [ { "id": 4886, "name": "Twentytwelve", "public": 0, "open": 0, "created": "2013-04-12T09:24:42+0000" }, { "id": 4537, "name": "contact form", "public": 0, "open": 0, "created": "2013-04-02T23:00:06+0000" }, { "id": 6639, "name": "POEditor WP plugin", "public": 0, "open": 0, "created": "2013-06-05T17:41:25+0000" }, { "id": 6268, "name": "Test Project", "public": 0, "open": 0, "created": "2013-05-23T14:26:34+0000" } ] } } ``` -------------------------------- ### View project details request and response Source: https://poeditor.com/docs/api Retrieve detailed information for a specific project by its ID. ```bash curl -X POST https://api.poeditor.com/v2/projects/view \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" ``` ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "project": { "id": 7717, "name": "Automobile", "description": "Automobile", "public": 0, "open": 0, "reference_language": "fr", "fallback_language": "", "terms": 783, "terms_last_added": "2024-02-25T11:49:13+0000", "terms_last_updated": "2024-02-25T11:51:05+0000", "created": "2013-07-04T17:44:37+0000" } } } ``` -------------------------------- ### List Project Terms with cURL Source: https://poeditor.com/docs/api Use this cURL command to retrieve all terms and their translations for a specific project and language. Ensure you have a readonly API token and the project ID. ```bash curl -X POST https://api.poeditor.com/v2/terms/list \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" \ -d language="en" ``` -------------------------------- ### Add Project using cURL Source: https://poeditor.com/docs/api Use this snippet to create a new localization project. Requires an API token and a project name. ```bash curl -X POST https://api.poeditor.com/v2/projects/add \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d name="Automobile" ``` -------------------------------- ### POST /projects/view Source: https://poeditor.com/docs/api Retrieves detailed information about a specific localization project. ```APIDOC ## POST /projects/view ### Description Returns the localization project's details. ### Method POST ### Endpoint https://api.poeditor.com/v2/projects/view ### Parameters #### Request Body - **api_token** (string) - Required - Your POEditor API key. - **id** (integer) - Required - The id of the project. ### Request Example curl -X POST https://api.poeditor.com/v2/projects/view \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" ### Response #### Success Response (200) - **project** (object) - Project details including id, name, description, reference_language, and statistics. #### Response Example { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "project": { "id": 7717, "name": "Automobile", "description": "Automobile", "public": 0, "open": 0, "reference_language": "fr", "fallback_language": "", "terms": 783, "terms_last_added": "2024-02-25T11:49:13+0000", "terms_last_updated": "2024-02-25T11:51:05+0000", "created": "2013-07-04T17:44:37+0000" } } } ``` -------------------------------- ### POST /projects/list Source: https://poeditor.com/docs/api Retrieves a list of all localization projects owned by the authenticated user. ```APIDOC ## POST /projects/list ### Description Returns the list of localization projects owned by the user. ### Method POST ### Endpoint https://api.poeditor.com/v2/projects/list ### Parameters #### Request Body - **api_token** (string) - Required - Your POEditor API key. ### Request Example curl -X POST https://api.poeditor.com/v2/projects/list \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" ### Response #### Success Response (200) - **projects** (array) - List of project objects containing id, name, public, open, and created fields. #### Response Example { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "projects": [ { "id": 4886, "name": "Twentytwelve", "public": 0, "open": 0, "created": "2013-04-12T09:24:42+0000" } ] } } ``` -------------------------------- ### POST /languages/available Source: https://poeditor.com/docs/api Retrieves a comprehensive list of all languages supported by POEditor. ```APIDOC ## POST https://api.poeditor.com/v2/languages/available ### Description Returns a comprehensive list of all the languages supported by POEditor. ### Method POST ### Endpoint https://api.poeditor.com/v2/languages/available ### Parameters #### Request Body - **api_token** (string) - Required - Get token readonly accepted ### Request Example curl -X POST https://api.poeditor.com/v2/languages/available -d api_token="a9824103d8729b923fbe1d268ec69ef9" ### Response #### Success Response (200) - **languages** (array) - List of supported languages with name and code #### Response Example { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "languages": [ {"name": "Abkhazian", "code": "ab"}, {"name": "Zulu", "code": "zu"} ] } } ``` -------------------------------- ### Export Project File via cURL Source: https://poeditor.com/docs/api Requests a download URL for a project file in a specified format. ```bash curl -X POST https://api.poeditor.com/v2/projects/export \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" \ -d language="fr" \ -d type="po" \ -d fallback_language="en" ``` -------------------------------- ### POST /terms/list Source: https://poeditor.com/docs/api Retrieves a list of terms for a specific project, including translations if a language code is provided. ```APIDOC ## POST https://api.poeditor.com/v2/terms/list ### Description Returns the project's terms and translations if the argument language is provided. ### Method POST ### Endpoint https://api.poeditor.com/v2/terms/list ### Parameters #### Request Body - **api_token** (string) - Required - Get token readonly accepted - **id** (integer) - Required - The project id - **language** (string) - Optional - The language code ### Request Example curl -X POST https://api.poeditor.com/v2/terms/list \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" \ -d language="en" ### Response #### Success Response (200) - **response** (object) - Status information - **result** (object) - Contains the list of terms #### Response Example { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "terms": [ { "term": "app_name", "context": "", "plural": "", "created": "2013-06-10T11:08:54+0000", "updated": "", "translation": { "content": "TODO List", "fuzzy": 0, "proofread": 1, "updated": "2013-06-12T11:08:54+0000" }, "reference": "", "tags": ["first_upload", "second_upload"], "comment": "Don't translate the name of the app" } ] } } ``` -------------------------------- ### POST /terms/add Source: https://poeditor.com/docs/api Adds new terms to a specified localization project using a JSON-formatted data string. ```APIDOC ## POST https://api.poeditor.com/v2/terms/add ### Description Adds terms to the localization project. ### Method POST ### Endpoint https://api.poeditor.com/v2/terms/add ### Parameters #### Request Body - **api_token** (string) - Required - Get token - **id** (integer) - Required - The project id - **data** (string) - Required - JSON format containing terms to add ### Request Example curl -X POST https://api.poeditor.com/v2/terms/add \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" \ -d data="[{\"term\":\"Add new list\"}]" ### Response #### Success Response (200) - **response** (object) - Status information - **result** (object) - Contains parsed and added counts #### Response Example { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "terms": { "parsed": 1, "added": 1 } } } ``` -------------------------------- ### Upload Terms using cURL Source: https://poeditor.com/docs/api Use this cURL command to upload terms to a POEditor project. Ensure you replace 'pathtofile/filename.po' with the actual file path. ```bash curl -X POST https://api.poeditor.com/v2/projects/upload \ -F api_token="a9824103d8729b923fbe1d268ef9" \ -F id="7717" \ -F updating="terms" \ -F file=@"pathtofile/filename.po" \ -F tags="{\"obsolete\":\"removed-strings\"}" ``` -------------------------------- ### Sync Project Terms via cURL Source: https://poeditor.com/docs/api Updates project terms by sending a JSON array. Use with caution as unmatched terms will be deleted. ```bash curl -X POST https://api.poeditor.com/v2/projects/sync \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" \ -d data="[{\"term\":\"Add new list\"}, {\"term\":\"Add new item\"}]" ``` -------------------------------- ### Poeditor API Response for List Terms Source: https://poeditor.com/docs/api This is a sample JSON response when successfully listing terms from a Poeditor project. It includes status information and a list of terms with their translations and metadata. ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "terms": [ { "term": "app_name", "context": "", "plural": "", "created": "2013-06-10T11:08:54+0000", "updated": "", "translation": { "content": "TODO List", "fuzzy": 0, "proofread": 1, "updated": "2013-06-12T11:08:54+0000" }, "reference": "", "tags": [ "first_upload", "second_upload" ], "comment": "Don't translate the name of the app" }, { "term": "mark_as_unread", "context": "", "plural": "", "created": "2013-06-10T11:08:54+0000", "updated": "", "translation": { "content": "", "fuzzy": 0, "proofread": 0, "updated": "" }, "reference": "", "tags": [ "second_upload" ], "comment": "" }, { "term": "One Item", "context": "", "plural": "%d Items", "created": "2013-06-10T11:24:12+0000", "updated": "", "translation": { "content": { "one": "", "other": "" }, "fuzzy": 0, "proofread": 0, "updated": "" }, "reference": "", "tags": [], "comment": "" } ] } } ``` -------------------------------- ### POST /languages/list Source: https://poeditor.com/docs/api Returns the project languages, translation progress, and last edit timestamp. ```APIDOC ## POST https://api.poeditor.com/v2/languages/list ### Description Returns the project languages, percentage of translation for each and the datetime (UTC - ISO 8601) when the last edit was made. ### Method POST ### Endpoint https://api.poeditor.com/v2/languages/list ### Parameters #### Request Body - **api_token** (string) - Required - Get token readonly accepted - **id** (integer) - Required - The project id ### Request Example curl -X POST https://api.poeditor.com/v2/languages/list -d api_token="a9824103d8729b923fbe1d268ec69ef9" -d id="7717" ### Response #### Success Response (200) - **languages** (array) - List of languages in the project with translation stats #### Response Example { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "languages": [ { "name": "English", "code": "en", "translations": 13, "percentage": 12.5, "updated": "2015-05-04T14:21:41+0000" } ] } } ``` -------------------------------- ### DeepL Provider - Split Sentences Option Source: https://poeditor.com/docs/api Control whether DeepL should split strings into sentences or treat each as a single unit. ```json { "split_sentences": "1" } ``` -------------------------------- ### POST /v2/projects/update Source: https://poeditor.com/docs/api Updates the settings of an existing localization project. Only provided fields will be updated. ```APIDOC ## POST /v2/projects/update ### Description Updates the project settings (name, description, reference language, fallback language). If optional parameters are not sent, their respective fields will not be updated. ### Method POST ### Endpoint https://api.poeditor.com/v2/projects/update ### Parameters #### Request Body - **api_token** (string) - Required - Your POEditor API token. - **id** (integer) - Required - The ID of the project to update. - **name** (string) - Optional - The new name for the project. - **description** (string) - Optional - The new description for the project. - **reference_language** (string) - Optional - The new reference language code. - **fallback_language** (string) - Optional - The new fallback language code. ### Request Example ```json { "api_token": "a9824103d8729b923fbe1d268ef9", "id": 7717, "name": "Automobile", "reference_language": "fr", "fallback_language": "en" } ``` ### Response #### Success Response (200) - **response** (object) - Contains status, code, and message. - **result** (object) - Contains updated project details. - **project** (object) - Details of the updated project. - **id** (integer) - The unique identifier for the project. - **name** (string) - The name of the project. - **description** (string) - The description of the project. - **public** (integer) - Indicates if the project is public (1) or private (0). - **open** (integer) - Indicates if the project is open (1) or closed (0). - **reference_language** (string) - The reference language code. - **fallback_language** (string) - The fallback language code. - **terms** (integer) - The number of terms in the project. - **created** (string) - The date and time the project was created. #### Response Example ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "project": { "id": 7717, "name": "Automobile", "description": "", "public": 1, "open": 0, "reference_language": "en", "fallback_language": "fr", "terms": 184, "created": "2014-08-13T09:39:32+0000" } } } ``` ``` -------------------------------- ### Update Project Settings using cURL Source: https://poeditor.com/docs/api Use this snippet to update project settings like name, reference language, and fallback language. The project ID is required. ```bash curl -X POST https://api.poeditor.com/v2/projects/update \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" \ -d name="Automobile" \ -d reference_language="fr" \ -d fallback_language="en" ``` -------------------------------- ### Add Terms to Project with cURL Source: https://poeditor.com/docs/api This cURL command demonstrates how to add new terms to a Poeditor project. The terms are provided in a JSON array format within the 'data' parameter. Ensure you use a valid API token and project ID. ```bash curl -X POST https://api.poeditor.com/v2/terms/add \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" \ -d data="[{"term":"Add new list"}]" ``` -------------------------------- ### POST /languages/add Source: https://poeditor.com/docs/api Adds a new language to the specified localization project. ```APIDOC ## POST https://api.poeditor.com/v2/languages/add ### Description Adds a new language to the localization project. ### Method POST ### Endpoint https://api.poeditor.com/v2/languages/add ### Parameters #### Request Body - **api_token** (string) - Required - Get token - **id** (integer) - Required - The project id - **language** (string) - Required - The language code ### Request Example curl -X POST https://api.poeditor.com/v2/languages/add -d api_token="a9824103d8729b923fbe1d268ec69ef9" -d id="7717" -d language="de" ### Response #### Success Response (200) - **message** (string) - Confirmation message #### Response Example { "response": { "status": "success", "code": "200", "message": "Language was added: German [de]" } } ``` -------------------------------- ### POST /v2/projects/delete Source: https://poeditor.com/docs/api Deletes a localization project from your account. You must be the owner of the project. ```APIDOC ## POST /v2/projects/delete ### Description Deletes the localization project from the account. You must be the owner of the project. ### Method POST ### Endpoint https://api.poeditor.com/v2/projects/delete ### Parameters #### Request Body - **api_token** (string) - Required - Your POEditor API token. - **id** (integer) - Required - The ID of the project to delete. ### Request Example ```json { "api_token": "a9824103d8729b923fbe1d268ef9", "id": 7717 } ``` ### Response #### Success Response (200) - **response** (object) - Contains status, code, and message. #### Response Example ```json { "response": { "status": "success", "code": "200", "message": "Project was deleted: Automobile [7717]" } } ``` ``` -------------------------------- ### Retrieve Available Languages Source: https://poeditor.com/docs/api Fetches a list of all languages supported by POEditor. ```bash curl -X POST https://api.poeditor.com/v2/languages/available \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" ``` ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "languages": [ { "name": "Abkhazian", "code": "ab" }, { "name": "Afar", "code": "aa" }, { "name": "Afrikaans", "code": "af" }, { "name": "Akan", "code": "ak" }, { "name": "Albanian", "code": "sq" }, { "name": "Amharic", "code": "am" }, { "name": "Arabic", "code": "ar" }, { "name": "Aragonese", "code": "an" }, { "name": "Armenian", "code": "hy" }, { "name": "Assamese", "code": "as" }, { "name": "Yiddish", "code": "yi" }, { "name": "Yoruba", "code": "yo" }, { "name": "Zhuang; Chuang", "code": "za" }, { "name": "Zulu", "code": "zu" } ] } } ``` -------------------------------- ### List Contributors API Request Source: https://poeditor.com/docs/api Use this endpoint to retrieve a list of contributors for a specific project. The project ID is required unless a language is specified, in which case it becomes mandatory. ```bash curl -X POST https://api.poeditor.com/v2/contributors/list \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="4886" ``` -------------------------------- ### DeepL Provider - Tag Handling Option Source: https://poeditor.com/docs/api Configure how tags (XML or HTML) are handled by the DeepL translation engine. ```json { "tag_handling": "" } ``` -------------------------------- ### POST /translations/automatic Source: https://poeditor.com/docs/api Triggers automatic machine translation for specified project strings using integrated providers. ```APIDOC ## POST /translations/automatic ### Description Gets machine translations from integrated providers for project strings. ### Method POST ### Endpoint https://api.poeditor.com/v2/translations/automatic ### Parameters #### Request Body - **api_token** (string) - Required - Get token - **id** (integer) - Required - The project id - **source_language** (string) - Required - The language code of the source language in POEditor. - **provider_source_language** (string) - Required - The language code from the provider that corresponds to the source_language. - **provider** (string) - Required - google, microsoft, or deepl - **target_languages** (string) - Required - A JSON of the languages to translate to. - **options** (string) - Optional - A JSON of the advanced options for the selected provider. ### Request Example curl -X POST https://api.poeditor.com/v2/translations/automatic \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" \ -d source_language="en" \ -d provider_source_language="en" \ -d provider="google" \ -d target_languages="[{\"project_language\":\"it\",\"provider_language\":\"it\"},{\"project_language\":\"fr\",\"provider_language\":\"fr\"}]" \ -d options="{\"tag\":\"new\",\"format\":\"html\"}" ### Response #### Success Response (200) - **response** (object) - Status information - **result** (object) - Contains successful and failed translation attempts #### Response Example { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "successful": [ { "source": "en", "target": "fr", "chars": 7 } ], "failed": [ { "source": "en", "target": null, "message": "Invalid pair." } ] } } ``` -------------------------------- ### List Project Languages Source: https://poeditor.com/docs/api Retrieves languages currently in a project, including translation progress and last update timestamps. ```bash curl -X POST https://api.poeditor.com/v2/languages/list \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" ``` ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "languages": [ { "name": "English", "code": "en", "translations": 13, "percentage": 12.5, "updated": "2015-05-04T14:21:41+0000" }, { "name": "French", "code": "fr", "translations": 70, "percentage": 68.75, "updated": "2015-04-30T08:59:34+0000" } ] } } ``` -------------------------------- ### DeepL Provider - Preserve Formatting Option Source: https://poeditor.com/docs/api Instruct DeepL to respect the original formatting, including punctuation and capitalization, of the source text. ```json { "preserve_formatting": "0" } ``` -------------------------------- ### Add Contributor API Request Source: https://poeditor.com/docs/api Use this endpoint to add a new contributor to a project. The project ID, contributor's name, and email are required. Language is mandatory if adding a contributor, and optional if adding an administrator. ```bash curl -X POST https://api.poeditor.com/v2/contributors/add \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" \ -d name="caesar" \ -d email="email@email.com" \ -d language="en" ``` -------------------------------- ### Export API Source: https://poeditor.com/docs/api Exports project translations in various formats. The generated link expires after 10 minutes. ```APIDOC ## POST /v2/projects/export ### Description Returns a download link for the project's translations. The link expires after 10 minutes. The export settings will inherit those from the project at the time of download. ### Method POST ### Endpoint https://api.poeditor.com/v2/projects/export ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **api_token** (string) - Required - Your API token. - **id** (integer) - Required - The project ID. - **language** (string) - Required - The language code for the export (e.g., 'fr'). - **type** (string) - Required - The file format for the export. Supported types include: `arb`, `csv`, `ini`, `key_value_json`, `i18next`, `json`, `po`, `pot`, `mo`, `properties`, `resw`, `resx`, `ts`, `apple_strings`, `xliff`, `xcstrings`, `xlf`, `xmb`, `xtb`, `xliff_1.2`, `rise_360_xliff`, `xls`, `xlsx`, `android_strings`, `yml`. - **filters** (string) - Optional - Filters results by 'translated', 'untranslated', 'fuzzy', 'not_fuzzy', 'automatic', 'not_automatic', 'proofread', 'not_proofread'. Can be a single string or a JSON array for multiple filters. - **order** (string) - Optional - Set to `terms` to order results alphabetically by terms. - **tags** (string) - Optional - Filters results by tags. Can be a single string or a JSON array for multiple tags. - **fallback_language** (string) - Optional - The language code of the fallback language to use. - **options** (string) - Optional - Advanced options for specific formats, provided as a JSON array of objects. Example: `[{"unquoted": 1}]` for Android XML without quotes. ### Request Example ```curl curl -X POST https://api.poeditor.com/v2/projects/export \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" \ -d language="fr" \ -d type="po" \ -d fallback_language="en" ``` ### Response #### Success Response (200) - **response** (object) - Contains status, code, and message. - **result** (object) - Contains the export URL. - **url** (string) - The download URL for the exported file (expires in 10 minutes). #### Response Example ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "url": "https:\/\/api.poeditor.com\/v2\/download\/file\/b577a66ac39d82995debfabc016f855d" } } ``` ### Filters Example ``` filters=translated filters=["translated"] filters=["translated", "not_fuzzy"] ``` ### Tags Example ``` tags=name-of-tag tags=["name-of-tag"] tags=["name-of-tag", "name-of-another-tag"] ``` ### Options Example ```json // Android Strings exported without wrapping the strings in quotes. options=[{"unquoted": 1}] // RESX and RESW files exported without encoding single and double quotes. options=[{"unencoded": 1}] // Xcstrings files exported containing all the languages in the project. options=[{"export_all": 1}] ``` ``` -------------------------------- ### Make Automatic Translation Request Source: https://poeditor.com/docs/api Use this cURL command to send a request for automatic translations. Ensure you replace placeholders with your actual API token, project ID, languages, and desired options. ```bash curl -X POST https://api.poeditor.com/v2/translations/automatic \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" \ -d source_language="en" \ -d provider_source_language="en" \ -d provider="google" \ -d target_languages="[{"project_language":"it","provider_language":"it"},{"project_language":"fr","provider_language":"fr"}]" \ -d options="{"tag":"new","format":"html"}" ``` -------------------------------- ### Poeditor API Response for Add Terms Source: https://poeditor.com/docs/api A successful response from the Poeditor API after adding terms to a project. It indicates the number of terms parsed and successfully added. ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "terms": { "parsed": 1, "added": 1 } } } ``` -------------------------------- ### Sync Terms API Source: https://poeditor.com/docs/api Synchronizes localization terms in a project. Terms not present in the provided data will be deleted. Use with caution as data loss can occur. ```APIDOC ## POST /v2/projects/sync ### Description Synchronizes your localization project with the provided array of terms. Terms not found in the JSON object will be deleted from the project and new ones will be added. Use with caution, as incorrect data can lead to irreversible loss of existing terms and translations. ### Method POST ### Endpoint https://api.poeditor.com/v2/projects/sync ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **api_token** (string) - Required - Your API token. - **id** (integer) - Required - The project ID. - **data** (string) - Required - JSON formatted string representing the terms to sync. Example: `[{"term":"Add new list"}, {"term":"Add new item"}]` ### Request Example ```curl curl -X POST https://api.poeditor.com/v2/projects/sync \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" \ -d data="[{"term":"Add new list"}, {"term":"Add new item"}]" ``` ### Response #### Success Response (200) - **response** (object) - Contains status, code, and message. - **result** (object) - Contains sync statistics. - **terms** (object) - **parsed** (integer) - Number of terms parsed. - **added** (integer) - Number of terms added. - **updated** (integer) - Number of terms updated. - **deleted** (integer) - Number of terms deleted. #### Response Example ```json { "response": { "status": "success", "code": "200", "message": "OK" }, "result": { "terms": { "parsed": 2, "added": 2, "updated": 0, "deleted": 2446 } } } ``` ### Data Example ```json [ { "term": "Add new list", "context": "", "reference": "\/projects", "plural": "", "comment": "" }, { "term": "one project found", "context": "", "reference": "\/projects", "plural": "%d projects found", "comment": "Make sure you translate the plural forms", "tags": [ "first_tag", "second_tag" ] }, { "term": "Show all projects", "context": "", "reference": "\/projects", "plural": "", "tags": "just_a_tag" } ] ``` ``` -------------------------------- ### Delete Project using cURL Source: https://poeditor.com/docs/api Use this snippet to delete a localization project. Requires an API token and the project ID. You must be the owner of the project. ```bash curl -X POST https://api.poeditor.com/v2/projects/delete \ -d api_token="a9824103d8729b923fbe1d268ef9" \ -d id="7717" ``` -------------------------------- ### Add Translations using cURL Source: https://poeditor.com/docs/api Use this cURL command to add new translations to a project. Ensure the 'data' parameter is a JSON array of translation objects. ```bash curl -X POST https://api.poeditor.com/v2/translations/add \ -d api_token="a9824103d8729b923fbe1d268ec69ef9" \ -d id="7717" \ -d language="en" \ -d data="[{"term":"Projects","context":"project list","translation":{"content":"Des projets"}}]" ``` -------------------------------- ### Google Provider - Format Option Source: https://poeditor.com/docs/api Specify the format of your strings (plain text or HTML) when using the Google translation provider. ```json { "format": "text" } ```