Retrieve translation data for a project
The 'type' parameter can be used to select between XLIFF 1.2 ('xliff') or CSV ('csv').
The 'include_translations_since' parameter is optional and is used to limit the response to contain only edits since the last import/export. The values for this are 'last-import' and 'last-export' respectively.
Before using this call, you'll need to authenticate against the API as detailed in Making your first call to the Project API.
All of these examples have simulation mode turned on. Once you are ready to use in a production environment, you can remove the simulation parameter. Any changes will then affect your account.
PHP
$nonce = get_nonce('https://api.elucidat.com/v2/projects/translations', '069C82FD-DCB0-D32C-5F95-EA256B4EB18E', '9927DDF5-EDD2-4CB6-0242-F012455E0658');
$headers = auth_headers('069C82FD-DCB0-D32C-5F95-EA256B4EB18E', $nonce);
$fields = array(
'project_code' => $arg1,
'type' => $arg2,
'include_translations_since' => $arg3,
'simulation_mode'=>'simulation');
$result = call_elucidat($headers, $fields, 'GET', 'https://api.elucidat.com/v2/projects/translations', '43601159-5921-4369-0777-3923967ADBCB');
echo ("HTTP status code: " . $result['status'] . "\n");
print_r($result['response']);
Ruby
nonce = client.get_nonce;
headers = client.auth_headers(nonce)
fields = {
'project_code' => arg1,
'type' => arg2,
'include_translations_since' => arg3,
'simulation_mode' => 'simulation'}
pp client.call_elucidat(headers, fields, 'GET', '/v2/projects/translations')
Python
nonce = get_nonce('https://api.elucidat.com/v2/projects', '43601159-5921-4369-0777-3923967ADBCB', 'A67122DE-D66F-F632-D669-1C2CEDA2A5C0')
headers = auth_headers('069C82FD-DCB0-D32C-5F95-EA256B4EB18E', nonce);
fields = [
('project_code', arg1),
('type', arg2),
('include_translations_since', arg3),
('simulation_mode', 'simulation')]
print call_elucidat(headers, fields, 'GET', 'https://api.elucidat.com/v2/projects/translations', 'A67122DE-D66F-F632-D669-1C2CEDA2A5C0')
Response (abridged)
"translations": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xliff version=\"1.2\">\n <file source-language=\"en-GB\" target-language=\"en-GB\" tool=\"Elucidat\" datatype=\"html\" original=\"https://app.elucidat.com/projects/edit/6033d7b58ca1f\">\n <header>\n <skl>\n <external-file uid=\"6033d6750c4ec-6033d7b58ca1f\" href=\"https://app.elucidat.com/projects/edit/6033d7b58ca1f\"/>\n </skl>\n <phase-group>\n <phase phase-name=\"extract\" process-name=\"extraction\" tool=\"Elucidat\" date=\"2021-11-29T09:27:30Z\" company-name=\"Omissis\" contact-name=\"Omissis Omissis\" contact-email=\"nick.cooke@elucidat.com\"/>\n </phase-group>\n </header>\n <body>\n <group id=\"theme_translations\">\n <trans-unit id=\"resource-item-download-title\">\n <source xml:lang=\"en-GB\"><![CDATA[Select this link to download]]></source>\n </trans-unit>\n <trans-unit id=\"sample-text\">\n <source xml:lang=\"en-GB\"><![CDATA[Sample text - This is an ideal place to enrich your learner's understanding of your topic. Enter as much or as little text here as you want.]]></source>\n <so