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:
grant_type: "password"client_id: Your OAuth client ID (integer)client_secret: Your OAuth client secretusername: Your FormNX account email addresspassword: Your FormNX account passwordscope: leave out or send an empty value
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()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.