Import Form

Saves and publishes a Nintex form when posting a NFP file to the endpoint. The Nintex Forms Package (NFP) file is a ZIP file with the extension .NFP that contains the configuration settings, variables, lists, content types and columns for a Nintex form. The file is backwards compatible for with the legacy Form.XML files exported from previous version of Nintex Forms designer.

For more information about the REST resource used to import a list form, see Importing a 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
POST {baseURL}/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 form was posted to the SharePoint list.
400 The specified package is not valid.
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 rel, href, and isTemplated property.
rel string If the form was successfully published, 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

This method is implemented so that message bodies for both requests and responses must be provided as wrapped JSON.

Example

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

Request

The following POST request attempts to import a Nintex form.

https://crestan.nintexo365.com/api/v1/forms/d41ef578-026a-4905-a55b-0ecc205cfee3

Request Body

The following XML body is the manifest that lists the contents of the NFP archive.

<?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 imported, and a response body containing the default view URL for the specified SharePoint list.

Response Body

The following response body contains the default view URL for the specified SharePoint list.

{

  "_links": [

     {

     "rel": "forms.publishdefault",

     "href": "/api/v1/forms/6263627c-57a6-42d0-9c87-2232e4e1899d/publish",

     "isTemplated": false

    }

  ]

}

Related information

Assigned use for Forms

Get Form

Publish Form

Save Form

Delete Form