MENU navbar-image

Introduction

Read your forms' submissions (responses) from your own code or tools, with OAuth2 authentication. Available on plans that include API Access.

This documentation aims to provide all the information you need to work with our API.

As you scroll, you will see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {token}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

To authenticate, first create an API client under My Profile → Manage Clients, then get an access token with a POST request to /oauth/token (form data or JSON) with these parameters:

Then include the token in the Authorization header: Bearer {your-token}. Tokens are valid for one year; use the refresh_token to get a new one.

Endpoints

Authorize a client to access the user's account.

requires authentication

Example request:
curl --request POST \
    "https://formnx.com/oauth/token" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://formnx.com/oauth/token"
);

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://formnx.com/oauth/token';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://formnx.com/oauth/token'
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request   

POST oauth/token

Headers

Authorization        

Example: Bearer {token}

Content-Type        

Example: application/json

Accept        

Example: application/json

Get Form Submissions

requires authentication

Retrieve paginated submissions for a specific form.

Example request:
curl --request GET \
    --get "https://formnx.com/api/form/47838d4a-d3e5-4e0f-876e-57b482e76cea/submissions?page=1&per_page=50&filters%5Bsearch%5D=John&filters%5Bis_starred%5D=1&filters%5Bstatus%5D=complete&filters%5Bis_draft%5D=&filters%5BtagSelected%5D[]=1&filters%5BtagSelected%5D[]=2&filters%5Bdate_range%5D=2024-01-01+-+2024-12-31&filters%5Bsort_by_submitted_on%5D=desc" \
    --header "Authorization: Bearer {token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://formnx.com/api/form/47838d4a-d3e5-4e0f-876e-57b482e76cea/submissions"
);

const params = {
    "page": "1",
    "per_page": "50",
    "filters[search]": "John",
    "filters[is_starred]": "1",
    "filters[status]": "complete",
    "filters[is_draft]": "0",
    "filters[tagSelected][0]": "1",
    "filters[tagSelected][1]": "2",
    "filters[date_range]": "2024-01-01 - 2024-12-31",
    "filters[sort_by_submitted_on]": "desc",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://formnx.com/api/form/47838d4a-d3e5-4e0f-876e-57b482e76cea/submissions';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {token}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'per_page' => '50',
            'filters[search]' => 'John',
            'filters[is_starred]' => '1',
            'filters[status]' => 'complete',
            'filters[is_draft]' => '0',
            'filters[tagSelected][0]' => '1',
            'filters[tagSelected][1]' => '2',
            'filters[date_range]' => '2024-01-01 - 2024-12-31',
            'filters[sort_by_submitted_on]' => 'desc',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://formnx.com/api/form/47838d4a-d3e5-4e0f-876e-57b482e76cea/submissions'
params = {
  'page': '1',
  'per_page': '50',
  'filters[search]': 'John',
  'filters[is_starred]': '1',
  'filters[status]': 'complete',
  'filters[is_draft]': '0',
  'filters[tagSelected][0]': '1',
  'filters[tagSelected][1]': '2',
  'filters[date_range]': '2024-01-01 - 2024-12-31',
  'filters[sort_by_submitted_on]': 'desc',
}
headers = {
  'Authorization': 'Bearer {token}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "current_page": 1,
    "data": [
        {
            "id": "9a7c1e52-3b0f-4c55-9d0e-2f6a1b8c4d11",
            "form_id": "47838d4a-d3e5-4e0f-876e-57b482e76cea",
            "submission_ref": "FNX-1042",
            "visitor_key": "432d78cf",
            "data": {
                "field_1": "John Doe",
                "field_2": "[email protected]",
                "field_3": "https://files.example.com/1/form_uploads/photo.png"
            },
            "status": "complete",
            "is_starred": 0,
            "response_status": {
                "id": 3,
                "name": "Reviewed",
                "color": "#2fb344"
            },
            "tags": [
                {
                    "id": 11,
                    "name": "VIP"
                }
            ],
            "quiz_score": null,
            "quiz_total_points": null,
            "time_taken": 74,
            "utm_params": {
                "utm_source": "newsletter"
            },
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z"
        }
    ],
    "first_page_url": "https://formnx.com/api/form/47838d4a-d3e5-4e0f-876e-57b482e76cea/submissions?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://formnx.com/api/form/47838d4a-d3e5-4e0f-876e-57b482e76cea/submissions?page=1",
    "links": [],
    "next_page_url": null,
    "path": "https://formnx.com/api/form/47838d4a-d3e5-4e0f-876e-57b482e76cea/submissions",
    "per_page": 100,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}
 

Example response (401, Missing or invalid token):


{
    "message": "Unauthenticated."
}
 

Example response (403, Not your form):


{
    "success": false,
    "msg": "Unauthorized. You do not have access to this form."
}
 

Example response (403, Plan without API access):


{
    "success": false,
    "msg": "Your current plan does not include API Access. Upgrade to manage API clients and integrate the REST API into your workflows."
}
 

Example response (404, Unknown form ID):


{
    "success": false,
    "msg": "Form not found."
}
 

Example response (422, Invalid filter):


{
    "success": false,
    "msg": "Invalid date_range format. Expected \"YYYY-MM-DD - YYYY-MM-DD\"."
}
 

Example response (429, More than 60 requests a minute):


{
    "message": "Too Many Attempts."
}
 

Example response (500):


{
    "success": false,
    "msg": "An error occurred while fetching form submissions"
}
 

Request   

GET api/form/{form_id}/submissions

Headers

Authorization        

Example: Bearer {token}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

form_id   string     

The ID of the form. Example: 47838d4a-d3e5-4e0f-876e-57b482e76cea

Query Parameters

page   integer  optional    

The page number. Default: 1. Example: 1

per_page   integer  optional    

Number of results per page, 1 to 1000. Default: 100. Example: 50

filters[search]   string  optional    

Text to look for in the answers (case-insensitive). Example: John

filters[is_starred]   boolean  optional    

Set to 1 to return only starred submissions. Example: true

filters[status]   string  optional    

Return only one status: complete (submitted), incomplete (saved as draft or waiting for payment) or partial (auto-saved while the form was still being filled in). Default: all. Example: complete

filters[is_draft]   boolean  optional    

Set to 1 to return only incomplete (draft) submissions (same as filters[status]=incomplete). Example: false

filters[tagSelected]   integer[]  optional    

One tag ID, or several (a submission must have all of them).

filters[date_range]   string  optional    

Submission date range in "YYYY-MM-DD - YYYY-MM-DD" format. Example: 2024-01-01 - 2024-12-31

filters[sort_by_submitted_on]   string  optional    

Sort by submission date: asc (oldest first) or desc (newest first). Default: desc. Example: desc