You can quickly and easily export, import, migrate, save, and publish forms from Nintex Forms for Office 365 by using the NintexForms for Office 365 REST API. The quick start provided here demonstrates the REST API, by walking you through the steps needed to export a Nintex form from SharePoint Online.
To use the API, establish your credentials and the endpoint. Use a REST client to contact the endpoints. The following quick start walks you through the following steps:
Before you can begin you will need:
Once that's done, you need to request your API key and API URL from Nintex. The API key authorizes you to invoke the REST resources included with the REST API. You will need to use the API URL to connect to your API endpoints.. Without these, you can't authorize the REST API with your SharePoint site. You'll include the API key as a header value in every request that uses the REST API, as described in Authentication and authorization. You will need to use the API URL as the base URL described in Base URL.
Contact your Nintex representative to request an API key and API URL for the REST API.
The following section will look at using the REST service using HTTP calls in order to orient you to use the API. You must first get your authentication cookie from the SharePoint 0365 tenancy that you plan on working with. You can retrieve the authentication cookie via HTTP, with a .Net REST client, or by using Windows PowerShell.
Send the following information to the SharePoint to get your authentication cookie:
The cookie will have the following format: Cookie, Site URL, SPOIDCRL = cookiestring
You can find detailed code samples for C# in the Guide section which include five samples using Microsoft's HTTPClient library. The following code snippet highlights how these clients retrieve the authorization cookie:
var login = "Username";
var password = "password";
var siteUrl = "siteURL";
var creds = new SharePointOnlineCredentials(login, password);
var auth = creds.AuthenticateAsync(new Uri(siteUrl), true);
var request = (HttpWebRequest)WebRequest.Create(siteUrl);
request.CookieContainer = auth.Result.CookieContainer;
var result = (HttpWebResponse)request.GetResponse();
You can find a Windows PowerShell script that demonstrates how to use the GetAuthenticationCookie method to retrieve an authentication cookie for the SharePoint 0365 tenancy using the credentials. For more information see "Windows PowerShell" in Authentication and authorization.
You will need the appropriate header information:
Using the authorization cookie from Step A.
Using the API Key from your site administrator.
The URL uses the following format: domainofo365tenant/api/v1/forms/listid
For example, to retrieve a form, you would use the following URL:
https://crestan.com//api/v1/forms/6263627c-57a6-42d0-9c87-2232e4e1899d
The API supports the following methods:
Action | HTTP Method | URI |
---|---|---|
Get Form | GET | https://{APIURL}/api/v1/forms/{listID},{contentTypeID} |
Import Form | POST | https://{APIURL}/api/v1/forms/{listID} |
Save Form | PUT | https://{APIURL}/api/v1/forms/{listID} |
Publish Form | POST | https://{APIURL}/api/v1/forms/{listID}/publish |
Delete Form | DELETE | https://{APIURL}/api/v1/forms/{listID},{contentTypeID} |
The Guide provides practical information and examples for each REST resource and operation included with the REST API. Experiment with the examples provided in the Guide to get a better idea about how to use the REST API.
The API Reference contains an overview of the technical information you'll need to use the REST API, as well as detailed reference information about the REST resources, data types, request and response bodies, and other elements included with the REST API. The API Reference is the best place to answer technical questions about implementing the REST API