Imports the contents of a Nintex Workflow for Office 365 export (.nwp) file into the specified existing workflow.
Method | Request URI | HTTP Version |
---|---|---|
PUT | https://{baseURL}/api/v1/workflows/packages/{id}[?{migrate}][&{listTitle}] | HTTP/1.1 |
The following table describes required and optional required parameters.
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. |
id |
Required. A GUID that represents the identifier of the workflow into which the export file is to be imported or migrated. |
migrate |
Optional. If included, 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. Specifies 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. 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 existing workflow, and the _links property contains links to other relevant operations of the existing workflow, relative to the SharePoint site.
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 list workflow for the given ID already exists in the site, the specified listTitle value cannot be different from the existing workflow. In other words, an existing list workflow cannot be moved from one list to another.
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, even if it was published prior to performing the operation.
The following example demonstrates how to use this operation to import into an existing workflow from an export file.
The following PUT request attempts to import an existing workflow from an export file specified in the request body.
https://crestan.nintexo365.com/api/v1/workflows/packages/99777373-a65a-4f49-af7a-f28c2f33a0a8
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 200 response code is returned, indicating that the existing workflow was successfully imported.
The response body contains the following Message object, in which the identifier for the existing 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 } ] }