form_get ()

form_get ()

Function prototype

form_get (session, form_id)

API Version

All

Supported interfaces

SOAP, REST (Since API Version 2.8.1)

Description

Returns information about a FORM.

Detailed explanation of the function.

Input parameters:

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

  • form_id: reference of the FORM.

Output parameters:

  • result: XML with the information about the FORM:

    • ref: form code

    • form_code: Universal Identifier of the form

    • short_name: form short name in the session language

    • parent_type: can be either TASK or EVENT

    • parent_id: the task or event identifier

    • parent_status: status of the parent TASK (see TASK STATUS OBJECT). Introduced in API Version 2.7.19

    • parent_locked: (true/false) Indicates if the parent TASK is locked. Introduced in API Version 2.7.19

    • date: Is the closed date (if closed) or program date (if open)

    • status:

      • OPEN

      • CLOSED

      • CANCELLED. A FORM is considered to be cancelled if it was open when the parent TASK was cancelled. Introduced in API Version 2.7.19

    • content_type: type of object (FORM, REPORT, DOCUMENT, PHOTO, DEVICE)

    • nav_mode: Navigation mode. Suggestion about how to present the questions of the FORM. See NAVIGATION_MODE property of ITEM TEMPLATE OBJECT. Introduced in API version 2.7.21

    • template: the original template_id

    • attachments: List of files attached to this FORM. See ITEM TYPE: "ATTACHMENT" for more information. Each attachment consists of the following information. This node exists since API Version 2.7.9

      • filename: Name of the attachment (includes name and file extension)

      • mime_type: MIME type of the attached file. See MIME Types & File extensions for more information

      • url: A relative URL to download the resource bytes via HTML5 Streaming

    • permissions: list of permissions on the requested FORM granted to the active user. Introduced in API Version 2.8.1

      • open: Permission to open the FORM (if it is closed)

      • close: Permission to close the FORM (if it is open)

      • edit: permission to edit the properties of the FORM

      • delete: permission to delete the FORM

      • alter_contents: permission to modify the contents of the FORM (inner ITEMS)

  • 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

form_open( “LCAAAAAAAAAA”, “1234”);

Response

The response format is XML when the function has been invoked via the SOAP API, and JSON when it has been invoked via the REST API

Return Error codes

ERROR CODE

 

ERROR CODE

 

INVALID_TOKEN

The session token provided is not valid

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to create request the 'form_id' indicated

FORM.NOT_FOUND

The FORM reference provided in parameter form_id does not correspond to an existing FORM