AgileApps Support Wiki Pre Release

Difference between revisions of "REST API:translationWorkbench Resource"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(24 intermediate revisions by the same user not shown)
Line 6: Line 6:
:* Translations have been created in the [[Translation Workbench]]
:* Translations have been created in the [[Translation Workbench]]


===Get a Translation===
===Get a Translation for a Custom Label===
;Method:GET
;Method:GET
 
;URI:<tt><nowiki>https://{domain}/networking/rest/__resourceName__/{recordId}</nowiki></tt>
;URI:
:Return all fields
:<tt>{{platformURL}}/rest/translationWorkBench/customlabel/{key}</tt>
;URI:<tt><nowiki>https://{domain}/networking/rest/__resourceName__/{recordId}?{query_parameters}</nowiki></tt>  
:<tt>{{platformURL}}/rest/translationWorkBench/customlabel/{key}?args=param1,...</tt>
:where:
::* '''{key}''' - The index value used to look up a translated string, in the form  <tt>{category}.{token_id}</tt>
 
{{Query Parameters|
{{Query Parameters|
:Introductory sentence, if any
::*<tt>args</tt> - A list of one or more arguments that will be interpolated into the string at the locations assigned to them when the base string was created.}}
::*<tt>parameter1</tt> - Description
::*<tt>parameter2</tt>
:::* If <tt>true</tt>, ...
:::* If '''<tt>false</tt>''', ... ('''default''')}}


;Response:
;Response:
:When the user's language is Spanish, this sample response comes in reply to the request:
::<tt>{{platformURL}}/rest/translationWorkBench/customlabel/validation.record_deleted?args=5</tt>
:<syntaxhighlight lang="xml" enclose="div">
:<syntaxhighlight lang="xml" enclose="div">
<platform>
<platform>
     <__resourceName__>
     <translationWorkBench>
         <id>...</id>
         <key>validation.record_deleted</key>
         <field>data</field>
         <translatedText>5 registros eliminados con éxito</translatedText>
        ...
     </translationWorkBench>
     </__resourceName__>


     <message>
     <message>

Latest revision as of 21:47, 30 March 2012

Get translated strings using the REST API.

Learn more: REST API Conventions and Considerations.

Requirements

Get a Translation for a Custom Label

Method
GET
URI
https://{yourDomain}/networking/rest/translationWorkBench/customlabel/{key}
https://{yourDomain}/networking/rest/translationWorkBench/customlabel/{key}?args=param1,...
where:
  • {key} - The index value used to look up a translated string, in the form {category}.{token_id}
Query Parameters
  • args - A list of one or more arguments that will be interpolated into the string at the locations assigned to them when the base string was created.
For more information, see: Specifying Query Parameters in REST APIs
Response
When the user's language is Spanish, this sample response comes in reply to the request:
https://{yourDomain}/networking/rest/translationWorkBench/customlabel/validation.record_deleted?args=5
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <translationWorkBench>
       <key>validation.record_deleted</key>
       <translatedText>5 registros eliminados con éxito</translatedText>
   </translationWorkBench>
   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Fields

Name Type Description
key String The ID of the translated element, in the form {category}.{token_id}. For example: validation.record_deleted
translatedText String The translation for the key, in the current user's language, with any arguments in the request interpolated into the string.