Imports the contents of a Nintex Workflow for Office 365 export (.nwp) file into a new workflow.
Method | Request URI | HTTP Version |
---|---|---|
POST | https://{baseURL}/api/v1/workflows/packages[?{migrate}][&{listTitle}] | HTTP/1.1 |
Request Parameter | Description |
---|---|
baseURL |
Required. The base URL for the Nintex Workflow for Office 365 REST API. For more information about the base URL, see Base URL. |
migrate |
Optional. A Boolean that indicates whether the operation attempts to map metadata within the export file to the corresponding values for the SharePoint site specified in the request header. If not specified, the default value is true. For more information about migrating workflows, see Importing into existing workflows. |
listTitle |
Optional. A string that represents the title of the SharePoint list into which the list workflow is migrated, overriding the list specified in the export file. This parameter is ignored for list workflows if migrate is set to false. If not specified, the default value is null. An error occurs if this parameter is specified when importing or migrating a site workflow. |
This operation uses only common request headers. For more information about common request headers, see Common headers.
This operation uses the contents of an export file, represented as a Base64-encoded binary value, in the request body.
This operation returns an HTTP status code, response headers, and a response body.
This operation returns only common HTTP status codes. For more information about common HTTP status codes returned by all operations, see Common status and error codes.
This operation returns only common response headers. For more information about common response headers returned by all operations, see Common headers.
If the operation was successful, the response body contains a Message object that represents the information returned by the operation about the imported workflow. Otherwise, the response body contains an Error object, which provides information about the error response. For more information about the Message and Error objects, see Response bodies.
For a successful response, the id property of the Message object represents the identifier of the new workflow, and the _links property contains links to other relevant operations for the new workflow, relative to the SharePoint site.
Use this operation to import or migrate a new workflow to a SharePoint site or list, by creating a new workflow and importing or migrating the contents of an existing export file into the new workflow.
If migrate is set to true, the operation performs the following actions:
If listTitle is also specified, the operation attempts to migrate the export file as a list workflow to the SharePoint list with the matching title on the SharePoint site, overriding the list specified in the list workflow. If the export file contains a site workflow, or a matching list cannot be found on the SharePoint site, an error occurs.
If the export file includes form definitions for custom Nintex task forms used by workflow actions, the form definitions are ignored by the operation if the destination does not support Nintex Forms integration; otherwise, the operation imports the form definitions.
If the export file includes encrypted data, the encrypted data is included for the new SharePoint site; otherwise, the encrypted data is cleared when the workflow is imported.
If migrate is set to false, the operation performs the following actions:
If the export file includes form definitions for custom Nintex task forms used by workflow actions, an error occurs if the destination does not support Nintex Forms integration; otherwise, the operation imports the form definitions.
If the export file includes encrypted data, the encrypted data is cleared when the workflow is imported.
To support Nintex Forms integration, Nintex Forms for Office 365 version 1.2.1.0 or greater must be installed.
If this operation is successful, the workflow must be published before it can be used.
The following example demonstrates how to use this operation to import a new workflow from an export file.
The following POST request attempts to import a new workflow from an export file specified in the request body.
https://crestan.nintexo365.com/api/v1/workflows/packages
The request body for the example contains a Base64-encoded binary value that represents the contents of the export file to be imported.
An HTTP 201 response code is returned, indicating that the export file was successfully imported into a new workflow.
The response body contains the following Message object, in which the identifier for the new workflow is specified in the id property and the operations relevant to the new workflow are described in the _links property.
{ "id": "99777373-a65a-4f49-af7a-f28c2f33a0a8", "_links": [ { "rel": "self", "href": "/api/v1/workflows/packages{?migrate,listTitle}", "isTemplated": true }, { "rel": "workflow.package.export", "href": "/api/v1/workflows/packages/99777373-a65a-4f49-af7a-f28c2f33a0a8", "isTemplated": false }, { "rel": "workflow.publish", "href": "/api/v1/workflows/99777373-a65a-4f49-af7a-f28c2f33a0a8/published", "isTemplated": false } ] }