DeleteForm
Deletes the saved Nintex form for the specified SharePoint list and content type.
Request
Method | Request URI | HTTP Version |
---|---|---|
POST | {endpointURL}/DeleteForm | 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, response headers, 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, a JSON-serialized object is returned that contains the following properties:
Property | Data type | Description |
---|---|---|
DeleteFormResult | string | If the form was successfully deleted, the relative URL of the default view for the specified SharePoint list, relative to the SharePoint site; otherwise, an empty string ("") |
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.
Invoking this request performs the following actions:
-
Deletes the Nintex Forms file for the form, if the file exists
-
Marks the form as deleted in Nintex Mobile, if appropriate
-
Deletes the form from Nintex Live Forms, if appropriate
-
Attempts to reset form templates, if necessary, for the specified content type and SharePoint list or document library
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 delete a Nintex form.
http://crestan.com/_vti_bin/NintexFormsServices/NfRestService.svc/DeleteForm
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 delete 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 deleted, 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.
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.
{ "DeleteFormResult": "/Lists/Test List/AllItems.aspx" }