POST /{api-connection}/items

Registering Content

Register a single content item for translation and receive translations

Summary

This call registers any text content inside a single item you post according to the source feed configuration. The call responds with a status code indicating the result of the registration OR can return the translated versions of this item if available. The item is registered for the target languages given in the request parameter target-language, and its status is reset for other target languages defined for this source feed but not present in target-language. This behaviour can be affected with the reset-all-target-languages parameter.

Request Body Format

Livewords Flow has an XSD available upon request which can greatly simplify many processes. However the request body is non-normative XML. This means the XML used does not need to conform to a fixed XML schema.

The request body XML is structured in items which are documented in detail in the Livewords Flow Items section.

Request Parameters

target-language

Optional. A comma-separated list of target locales. Defaults to all languages of targets defined in source.

The source feed must have at least one associated target for each locale code. Example: en-US,nl,de

reset-all-target-languages

Optional. A boolean parameter (true or false) indicating if this call should first reset the workflow status of the item before registering it as to-be-translated for the given target languages. Defaults to true.

This parameter modifies the effect of the target-language parameter and is only defined in combination with this parameter.

If set to true the workflow status of the item is first reset (i.e. its status is removed, if any) and is then registered as to-be-translated for the target languages given in the target-language parameter.

If set to false, the item in the request is only registered as to-be-translated for the target languages given in the target-language parameter. The status of the item for target languages other than present in target-language is left unchanged.

return-translations

Optional. A boolean parameter (true or false) to determine if translations should be sent back immediately. Defaults to false.

If set to true the translated items will be sent back immediately.

*Workflow status is: ToDo, Review, Review2 (in some cases), Published.

Examples With Parameters

If you have source with 2 languages: French and Italian.

  1. Send item without any parameters: item will appear in all languages in To Do
  2. Send item with target-language=fr and no reset-all-target-languages or reset-all-target-languages=true: item will be removed from Italian To Do and updated in French To Do
  3. Send item with target-language=it and reset-all-target-languages=false: item will be added to Italian To Do and updated in French To Do

 

Response

200 OK

Indicates a succesful operation.

413 Request Entity Too Large

The body of the POST request exceeds the default quotum of 16MB.

Example Request

Registers the item Hoodie for the source feed named products for translation in Dutch, French and German.

POST /products/items?target-language=nl,fr-FR,de
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<products>
  <product id="11" title="Hoodie">
    <title>Hoodie</title>
    <short-title>Short title</short-title>
    <description>This hoodie is blue and has stripes</description>
  </product>
</products>

Example Response

200 OK
Content-Type: text/xml
Content-Length: 449
Date: Tue, 14 Jan 2014 12:11:26 GMT

<?xml version="1.0" encoding="UTF-8"?>
<translation-responses>
  <translation-response xml:lang="nl">
    <products>
      <product id="11" title="Hoodie">
        <title>Trui met capuchon</title>
        <short-title>Korte titel</short-title>
        <description>Deze trui met capuchon is blauw en heeft strepen</description>
      </product>
    </products>
  </translation-response>

  <translation-response xml:lang="fr-FR">
    <products>
      <product id="11" title="Hoodie">
        <title>Sweat a capuche</title>
        <short-title>Titre courte</short-title>
        <description>Ce sweat a une capuche et des bandes</description>
      </product>
    </products>
  </translation-response>

  <translation-response xml:lang="de">
    <products>
      <product id="11" title="Hoodie">
        <title>Hoodie</title>
        <short-title>Kurztitel</short-title>
        <description>Dieser Hoodie ist blau und Streifen</description>
      </product>
    </products>
  </translation-response>
</translation-responses>
 
Have more questions? Submit a request

Comments