Save Form

Saves the form to a specified SharePoint list and return the URI that will publish the form.

Note: This API supports forms designed using the Classic Forms and Responsive Forms designers. Forms designed using the New Responsive Forms designer are not supported.

Request

Method Request URI HTTP Version
PUT {basetURL}/api/v1/forms/{listId} 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" above.

Request Headers

The following table describes required and optional request headers.

Request Header Description
Content-Type Required. application/json
Authorization Required. SharePoint form digest value, used to authenticate the request.

Request Body

An object, serialized in JavaScript Object Notation (JSON), which 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.
application/nfp attachment; filename=NFForm.nfp A file archive containing the Nintex form definition files.

Response

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

Response Codes

Code Description
200 The specified form was saved.
400 An invalid operation has occurred.
401 An invalid request body was specified.
404 The specified list 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/json; charset=utf-8
Content-Type The length, in characters, of the response body.
Cache-Control private

Response Body

If the method was successful, a JSON-serialized object is returned that contains the following properties:

Property Data type Description
_links string Contains the properties rel, href, and IsTemplated.
rel string If the form was successfully publshed, the relative URL of the default view for the specified SharePoint list, relative to the SharePoint site; otherwise, an empty string ("")
href string A relative URL of the endpoint to publish the form.

isTemplated

boolean

Indicates if the form uses a template.

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

Example

The following example demonstrates how to use this operation to save a Nintex form for a SharePoint list.

Request

The following POST request attempts to delete a Nintex form.

https://crestan.nintexo365.com/api/v1/forms/DB0ECEE6-117D-4519-986E-020A9BE6A7E3/publish

Request Body

The following XML body is the manifest that lists the contents of the NFP archive. The contentTypeId property is not specified.

<?xml version="1.0" encoding="utf-8"?>

<Manifest version="2.0.1">

  <Contents>

    <File name="FormLayouts" path="Form\FormLayouts.xml" hash="3010021C98ACD0D084B482505A8B1FE626541475" />

    <File name="FormSettings" path="Form\FormSettings.xml" hash="0BDEED88C82D26D4AF698C698BB4FD672098B6A2" />

    <File name="FormControls" path="Form\FormControls.xml" hash="45E589D6F39637C082FA64343F26071C3163AC88" />

    <File name="FormStyles" path="Form\FormStyles.xml" hash="76DF2ADF46F837ABCA8F63E08B8EE930C4A50402" />

    <File name="FormScripts" path="Form\FormScripts.xml" hash="D96DE89E4328B31151CA07AE55209B0BE4E1198D" />

    <File name="FormRules" path="Form\FormRules.xml" hash="BF2793DD750471051CCC5E319FF6E04F911DA1C8" />

    <File name="FormUserVariables" path="Form\FormUserVariables.xml" hash="C4DF8D5BBFF66675435FE0AC55D1F893E9FFB8CA" />

    <File name="FormLiveSettings" path="Form\FormLiveSettings.xml" hash="1B86D8DD58E7D4363D88D6E68865E0E4878044CF" />

  </Contents>

  <Properties>

     <Property name="Created">2016-01-08T23:45:19.5583206+00:00</Property>

  </Properties>

</Manifest>

Response

An HTTP 200 response code is returned, indicating that the form was successfully saved, and a response body containing the default view URL for end point to publish the form for the specified SharePoint list.

Response Body

The following response body contains the default end point to publish the form for the specified SharePoint list.

{

  "_links": [

    {  

       "rel": "forms.publishdefault",

       "href": "/api/v1/forms/b7fea5eb-db3c-45f5-b590-ddcd0b12bd4e/publish",

       "isTemplated": false

    }

  ]

}

Related information

Assigned use for Forms

Get Form

Import Form

Publish Form

Delete Form