† library_form_set_literals ()

† library_form_set_literals ()

DEPRECATED in API Version 2.8.1. Replaced by the more generic function library_literals_set ()

Function prototype

library_form_set_literals (session, form , literals)

API Version

2.7.26 and higher

Supported interfaces

SOAP, REST

Description

Modifies the literals used in this FORM TEMPLATE

This function allows to do a batch modification of the literals of a FORM TEMPLATE. It is possible to set the literals in different languages.

Input parameters:

  • session: is the session token obtained in the session_init() call

  • form: reference of the FORM TEMPLATE

  • literals: list of all the literals. Each element of the list contains:

    • ref: Reference of the literal. References of the literals can be obtained using the API function † library_form_get_literals ()

    • text: literal in the reference language (active session language)

    • lang: 2-letter ISO code of the language of the literal

Output parameters:

  • result: List of all the literals used in the FORM TEMPLATE:

  • ErrorMsg: If any error occurs, then this value contains a description of the error translated to the current language

  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request example

Request passing the list of literals in a XML

library_form_set_literals ( “LCAAAAAAAAAAAA”, 16384, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<literals> <literal> <ref>ajUtGSW3PDjWa9dw0QGVNg</ref> <text>饮酒</translated> <lang>ZH</lang> </literal> <literal> <ref>7HCAxQFgF1wv0W6VbaPTZA</ref> <text>现在我们要问您一些关于你的酒精摄入量的问题。</text> <lang>ZH</lang> </literal> </literals>" )

 

Request passing the list of literals in a JSON

library_form_set_literals ( “LCAAAAAAAAAAAA”, 16384, "[{ "ref": "ajUtGSW3PDjWa9dw0QGVNg", "text": "饮酒", "lang": "ZH" }, { "ref": "7HCAxQFgF1wv0W6VbaPTZA", "text": "现在我们要问您一些关于你的酒精摄入量的问题。" "lang": "ZH" }] " )

Return Error codes

ERROR CODE



ERROR CODE



INVALID_TOKEN

The session token provided is not valid

TEMPLATE.NOT_FOUND

The requested FORM TEMPLATE was not found

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to request the literals of the FORM TEMPLATE