REST API v3: POST template translations (drag and drop templates)
This method is used to create a new translation to a template with the REST API. It uses an HTTP POST request to the following address:
https://api.copernica.com/v3/ms/template/$id/translations?access_token=xxxx
Available parameters
- language: language of the template
JSON example
The following JSON demonstrates how to use the API method:
{
"language": "de_DE"
}
PHP example
The following PHP script demonstrates how to use the API method:
// dependencies
require_once('copernica-rest-api.php');
// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 3);
// data to be sent to the api
$data = array(
'language' => 'de_DE'
);
// do the call
$api->post("ms/template/$id/translations", $data);
The example above requires the CopernicaRestApi class.