Name: {name}
Übersetzt seit: {translator_since}
Aus: {from}
Bereits mit Ihnen gearbeitet: {collaboration}
{about}
{fieldofexpertise}
 {name}

Nativy Connect

nativy translations
Description Posts an order to nativy and just saves it for further use. (Hybrid models)
URL /connect/saveorder

Parameters
api_key (required) string The public API key of the user. (Details: Authentication )
timestamp (required) string The current UTC timestamp (seconds from 1/1/1970 until UTC now). (Details: Authentication )
api_sign (required) string The timestamp encoded with HMAC SHA1 in use of the private key. (Details: Authentication )
language_from (required) string The short key of the source language of your text. (Details: /languages GET)
language_to (required) string The short key of the language the text should be translated to. (Details: /languages GET)
correction_required (required) bool If true, a corrector will be assigned to the order. A corrector proofreads the translation of the translator and makes suggestions to him if there is something incorrect with the translation.
callbacklink (required) string The URL to which nativy connect posts back to your application at the following events:
  • the payment of the order was successful (?orderid=xyz&paid=1 will be appended to your callbacklink)
  • the translation completed ("?orderid=xyz" will be appended to your callbacklink)
  • the review of a text part completed("?orderid=xyz&text_to_key=xyz" will be appended to your callbacklink)
text_from (required1) array A string/string array of key/value pairs that should be translated by nativy. Provide an unique key for each text part, so you can assign the translated texts to the right place in your application later (see example call below for more details).
new XliffInput (required1) string A string which is formatted as Xliff v1.2 . Each trans-unit must contain exactly one source element. Each trans-unit can contain a note element for further instructions and remarks for translators.
new contentbundlereference (required1) string A string that reffers to a registered contentbundle (Details: /contentbundle POST).
nativy_partner_name string You may provide the name of the application which uses nativy connect (e.g. Drupal, Typo3, Sharepoint).
short_description string A short description of the whole text for the translator, e.g. "Text for a newsletter", "Product description"...
long_description string A more detailed description of the whole text for the translator.
weighting_price int A number between 1 and 10 which indicates how important the price is for the user.
8: low price is very important
2: low price is less important
weighting_duration int A number between 1 and 10 which indicates how important the delivery time is for the user.
8: quick delivery is very important
2: delivery time is less important
weighting_textmatching int A number between 1 and 10 which indicates how important it is that the translators previous translations match to your text.
8: match is very important
2: match is less important
weighting_cooperation int A number between 1 and 10 which indicates how important it is that user has already cooperated with the translator.
8: cooperation is very important
2: cooperation is less important
invoice_name_row_1 string The text for the first row that should be printed on the invoice address.
If this parameter is not provided the first name, last name and degree from the nativy users account will be taken.
invoice_name_row_2 string The text for the second row that should be printed on the invoice address.
If this parameter is not provided the company name from the nativy users account will be taken.
invoice_street string The street that should be printed on the invoice.
If this parameter is not provided the street from the nativy users account will be taken.
invoice_zip string The postal code (ZIP) that should be printed on the invoice.
If this parameter is not provided the postal code from the nativy users account will be taken.
invoice_city string The city that should be printed on the invoice.
If this parameter is not provided the city from the nativy users account will be taken.
invoice_country_code string The country that should be printed on the invoice.
Please specify a country code from the ISO 3166 standard.
If this parameter is not provided the country from the nativy users account will be taken.

1: Only one of these fields is required to contain a none-empty value. If text_from is not empty, then XliffInput will be ignored.


Example call (text_from)

                $url = 'http://www.nativytest.com/connect/saveorder';
        	    $api_key = 'iQU5lBuEjYFvx2EU2o>bp*u02x^Bmie3d}pg-pU^MZ&%mobYM&x7SHY+41u7PHEh';
        	    $private_key = '4i2j_F|=lcqNmxPaxtxsX-veXJ)i+w(hq[_J&(r{Pn[jyT&)xt*Usp3K%B_jv{tP';
        	    $timestamp = gmdate('U');
	            $hmac = hash_hmac('sha1', $timestamp, $private_key); 
	        
	            $text_from1 = array('Key' => 'mnuFile', 'Value' => 'File');
	            $text_from2 = array('Key' => 'mnuHelp', 'Value' => 'Help');
	            $text_from3 = array('Key' => 'about_text', 
	        					    'Value' => 'This is a demo about text.');

	            $order = array(
	        	    'api_key' => $api_key,
 			   	    'api_sign' => $hmac,
 			   	    'timestamp' => $timestamp,
	        	    'callbacklink' => 'http://MYWEBSITE/nativyconnect_callback.php',
	        	    'language_from' => 'en', 
	        	    'language_to' => 'de',
	        	    'text_from' => array($text_from1, $text_from2, $text_from3)
	            );
	        
	            $order = json_encode($order);
	        
	            $ch = curl_init($url); 
	            curl_setopt($ch, CURLOPT_URL, $url); 
			    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
	            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
	            curl_setopt($ch, CURLOPT_POST, 1); 
	            curl_setopt($ch, CURLOPT_POSTFIELDS, $order);
	            $response = curl_exec($ch);
	            curl_close($ch);

        	    echo ($response);
            

Example call (XliffInput)

                $url = 'http://www.nativytest.com/connect/saveorder';
        	    $api_key = 'iQU5lBuEjYFvx2EU2o>bp*u02x^Bmie3d}pg-pU^MZ&%mobYM&x7SHY+41u7PHEh';
        	    $private_key = '4i2j_F|=lcqNmxPaxtxsX-veXJ)i+w(hq[_J&(r{Pn[jyT&)xt*Usp3K%B_jv{tP';
        	    $timestamp = gmdate('U');
	            $hmac = hash_hmac('sha1', $timestamp, $private_key); 
	        
	            $XliffInput = '   
File Help This is a demo about text
' $order = array( 'api_key' => $api_key, 'api_sign' => $hmac, 'timestamp' => $timestamp, 'callbacklink' => 'http://localhost/nativyconnect_callback.php', 'language_from' => 'en', 'language_to' => 'de', 'XliffInput' => $XliffInput ); $order = json_encode($order); $ch = curl_init($url); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $order); $response = curl_exec($ch); curl_close($ch); echo ($response);

Return values

Saving an order returns an object containing a unique if of the saved order.

orderid  string The unique id of the order you posted (GUID transformed string).
status  string The status of the operation. ("failed" or "successful")

Example returns value

            {
                "status" : "successful",
                "orderid" : "772a3def-52fe-49bf-815c-89dd8b820ac3"
            }