GetFormXml

Retrieves the XML-encoded definition of a Nintex form for the specified SharePoint list and content type.

Request

Method Request URI HTTP Version
POST {endpointURL}/GetFormXml HTTP/1.1

Request Parameters

Request Parameter Description
endpointURL Required. The endpoint URL for the REST API. For more information about the endpoint URL, see Endpoint URL.

Request Headers

The following table describes required and optional request headers.

Request Header Description

Content-Type

Required. application/json

X-RequestDigest

Required. SharePoint form digest value, used to authenticate the request.

Request Body

An object, serialized in JavaScript Object Notation (JSON), that contains the following properties:

Property Data type Description
contentTypeId string Optional. The name or identifier of the SharePoint content type. If a value is not specified, the first content type defined for the list specified in listId is used.
listId string Required. The name or identifier of the SharePoint list or document library.

Response

The response includes an HTTP status code, header values, and a response body.

Response Codes

Code Description
200 The specified form was deleted.
400 An invalid operation has occurred.
401 An invalid request body was specified.
404 The specified form could not be found.
500 Internal error.

Response Headers

The following table describes response headers returned by a successful response. Other header values may also be returned, depending on SharePoint and ASP.NET configurations.

Request Header Description

Content-Type

application/xml; charset=utf-8

Content-Length

The length, in characters, of the response body.

Cache-Control

private

Response Body

If the method was successful, an XML-serialized string object is returned, which in turn contains an XML-serialized Form object that represents the Nintex form definition.

Otherwise, depending on the error, the method returns additional information about the error. For example, if the value of the listId property in the request body is set to a name or identifier that cannot be found on the SharePoint site, the response returns an HTTP 400 status code and a Request Error web page in which the error indicates that a list with the specified name does not exist.

Remarks

This method is implemented so that message bodies for requests must be provided as wrapped JSON, but message bodies for responses are provided as unwrapped XML.

Example

The following example demonstrates how to use this operation to get the definition of a Nintex form from a SharePoint list.

Request

The following POST request attempts to get the definition of a Nintex form.

http://crestan.com/_vti_bin/NintexFormsServices/NfRestService.svc/GetFormXml

Request Body

The following request body contains a JSON object in which the listId property is set to the identifier of the SharePoint list from which to get the form definition. The contentTypeId property is not specified.

{
  "listId": "{DB0ECEE6-117D-4519-986E-020A9BE6A7E3}"
}

Response

An HTTP 200 response code is returned, indicating that the form was successfully returned, and a response body containing the form definition.

Response Body

The following response body contains an XML-serialized string object, which in turn contains an XML-encoded serialization of a Form object.

Note: The contents of the response body have been edited for readability. Content has been replaced with an ellipsis (...) and line breaks have been added.

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
    &lt;?xml version="1.0" encoding="utf-16"?&gt;
    &lt;Form xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Nintex.Forms"&gt;
    &lt;AddListFormWebPartSubmitMessage&gt;false&lt;/AddListFormWebPartSubmitMessage&gt;
    &lt;Category i:nil="true" /&gt;
    ...
    &lt;/Form&gt;
</string>

Related information

Migrate Forms with the Nintex Forms Web Service API

Web Service Reference