Push translations back into Elucidat once translated
This is achieved by sending the content of a translation file in the 'translations' parameter. Please note that you are not restricted to the original project the data was exported from, but results from pushing into a different project may vary.
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', '43601159-5921-4369-0777-3923967ADBCB', 'A67122DE-D66F-F632-D669-1C2CEDA2A5C0');
$headers = auth_headers('43601159-5921-4369-0777-3923967ADBCB', $nonce);
$fields = array(
'project_code' => $arg1,
'type' => $arg2,
'translations' => $arg3,
'simulation_mode'=>'simulation');
$result = call_elucidat($headers, $fields, 'POST', 'https://api.elucidat.com/v2/projects/translations', 'A67122DE-D66F-F632-D669-1C2CEDA2A5C0');
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,
'translations' => arg3,
'simulation_mode' => 'simulation'}
pp client.call_elucidat(headers, fields, 'POST', '/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('43601159-5921-4369-0777-3923967ADBCB', nonce);
fields = [
('project_code', arg1),
('type', arg2),
('translations', arg3),
('simulation_mode', 'simulation')]
print call_elucidat(headers, fields, 'POST', 'https://api.elucidat.com/v2/projects/translations', 'A67122DE-D66F-F632-D669-1C2CEDA2A5C0')
Response
{
"message": "Translation imported",
"translated": "5",
"status_code": "200"
}