Authentication

API requests may be authenticated in one of two ways:

  • Include your API key in the header (recommended)
  • Include your API key as a query parameter
  • Include your API key in the JSON body (only available for POST requests)
Authorization Header Example (Recommended)

Including your key in the Authorization header is the recommended approach, as it will work for all request types, and it will eliminate the need to include your key as a query parameter or object property. Here is an example using the Axios HTTP library to set the header:

const response = await axios.get({
  url: 'https://api.nextform.app/forms',
  headers: { 'Authorization': YOUR_API_KEY }
})

Query Parameter Example

Your key may be included as a query parameter on any request. Here is an example of a List Forms request using a query parameter to set the API key:

GET https://api.nextform.app/forms
?key=YOUR_API_KEY
&reference=f7ddd038-f16f-4211-a78c-6647e116442a

Object Property Example

Your key may be included as an object property on POST requests. Here is an example of a session creation:

POST https://api.nextform.app/sessions
{
  "key": "YOUR_API_KEY",
  "formType": "w9Oct2018"
}