Elements of the API

This topic looks at the information needed to create a valid API request.

To use the API you will need perquisite information to create a request. Prerequisites include:

For more information on prerequisites see Prerequisites for working with the API.

Parts of a request

To place the information in context, the following image shows the elements of the NintexOffice 365 API call to the following endpoint:

PUT https://yourtenant.nintexo365.com/api/v1/forms/BBE1894B-7148-4E8E-9118-DDCB12497516,0x01006ACB74139E82C34FB9A168AE0D163CB4/assigneduse

The following table contains an explanation of each area.

Area Name Description

1

HTTP Method

RESTful endpoints can receive HTTP methods that include verbs such send Get, Post, Put, Delete, and so on. You can refer to the end-point reference for each endpoint to find out the expected method. For more information, see REST Resources.

2

Endpoint URL

The URL for the endpoint, also known as the URI (for Uniform Resource Identifier) is structured to handle an incoming request and pass specific information to the endpoint necessary to prepare the return payload. The endpoint is a connection point exposed via HTTP of a live function.

The URL uses the following format:

[1]https://[2]yourtenant.nintexO365.com/[3]api/v1/[4]endpoint/[5]identifiers

The URL has the following elements:

  1. Uses a secure hypertext transfer protocol (https) connection.
  2. The API call uses a specific URL provided to you by Nintex. This URL is different than the URL of your SharePoint tenant. Nintex will provide to you an API URL for your tenant. For more information, see Get your API key and API base URL.
  3. The API version number.
  4. This element specifies if it is the workflow or forms API.
  5. Identifiers such as the ListID, ContentypteID, and workflowID are used by the API to specify the workflow or form.

3

Headers

The headers in a REST call are key-value pairs separated by a colon and terminated by a new line. Typically headers start on the second line of a call and are part of the HTTP protocol. They can include keys such as cookie, content-type, and date.

You must include headers with your call to interact with the API. The specific calls will depend on the endpoint you are trying to contact, however, some common headers include:

  • Authorization (required). The authorization header contains a cookie and security token you will need to construct using a Windows PowerShell script. For more information see Create your authentication token.
  • Api-Key (required). The API Key is a 22 digit number that you will send as a header in your request. Nintex will provide to you an API key for your tenant. For more information, see Get your API key and API base URL.
  • ContentType (required). This is "application/json"
  • Accept (optional). If you are sending a request payload, for instance for the accepteduse endpoint, you will need to specify "application/json" as the accept header.
  • Environmental header (optional). Your tenant administrator may have configured a required header. This header will have a specific key and value. In the image, a key of Test-Environment has a value of 03. Check with your tenant administrator to find out if you they have configured a required header.

4

Body

In addition, the request may include information in the body of the email. This is also referred to as the request payload. To change the assigned use, for instance, of a form, would include the following JSON payload:

{

    "listID": "BBE1894B-7148-4E8E-9118-DDCB12497516",

    "contentTypeId":    "0x01006ACB74139E82C34FB9A168AE0D163CB4",
    "value": "production"

}

A POST request may include a workflow or forms package.

Additional information

Finally if you are new to using a RESTful API, you may want to learn more about how to use RESTful endpoints. You can find more information at "RESTful Web services: The basics."

Related information

Using the Office 365 API for Workflows and Forms