API Access: Setup and Troubleshooting
The API Access tab in the Account Management window is where you can enable and disable API access. For full API documentation, see our API DOCS.
API, an abbreviation for application program interface, is a set of routines, protocols, and tools for building software applications. The Logiforms REST API facilitates access to your forms and form submission data.
API DOCUMENTATION
On This Page
Enable/Disable Access
The default in your account is with the API Access enabled.
- Click "Disable API Access" to disable access to the API.
- Click Yes on the confirmation window.
Access is disabled.
Click "Enable API Access" to enable access.
Reset Token
Click "Reset API Token" to create a new token.
The new token displays on screen.
Examine Logs
Click "View Logs" to see the log screen.
On the log screen you can:
- delete all or selected entries.
- sort on any of the columns.
- close the window to return to the API Access tab.
Troubleshooting Record Queries (/data)
When you retrieve form submission data with the GET /api/1.0/form/{form_id}/data endpoint, a request may time out, fail with a server error, or return zero records. Find the problem you're seeing below:
- The request hangs or fails with a 500, 502, or 504 error
- The query returns 0 records
- Queries on large forms take a long time
- Requests fail with HTTP 429 Too Many Requests
The request hangs or fails with a 500, 502, or 504 error
Symptom: The request hangs for up to two minutes (120 seconds) and then fails with 502 Bad Gateway or 504 Gateway Timeout. Or it fails right away with an HTTP 500 error like this:
Invalid field id '<Field Name>' provided. SQL Level H007
Cause: When /data is called without a fieldlist parameter, Logiforms builds a query that selects every form element. The query fails if any field has a space in its Field Name property (for example, Update Record instead of UpdateRecord), or if a field is unmapped or disabled and has no database column behind it.
Quick workaround: Add a comma-separated fieldlist parameter and includeSysFields=none to the query string. The query then selects only the columns you list and skips the problem field:
https://forms.logiforms.com/api/1.0/form/{form_id}/data?fieldlist=RecordID,DateSubmitted,Billing_CompanyName&includeSysFields=none
Permanent fix:
- Open the form in Form Designer.
- Check the Form Outline and Element Properties of every field. Make sure each Field Name uses only letters and numbers, with no spaces (for example, rename
Update RecordtoUpdateRecord). - Delete any unmapped or unused disabled fields.
- In the top toolbar, click Settings > Rebuild Form & Clear Cache.
- Click Save.
The query returns 0 records
Symptom: The API responds with HTTP 200 OK and an empty record list ("records": [], "record_count": 0), even though there are submissions that match your dates or criteria.
Cause: The API uses URL parameters both for system controls and for filtering on your own form fields (for example, ?company=Logiforms). If a form field has the same name as a reserved parameter, the API filters on that field instead of applying the system control. The reserved parameter names are:
startDate, endDate, page, startID, endID, dateFiltering, sortBy, sortOrder, includeSysFields, fieldlist
Fix:
- Open the form in Form Designer.
- Rename the conflicting field (for example, rename a field named
startDatetoSubmissionStartDateorEventDate). - Click Settings > Rebuild Form & Clear Cache.
- Click Save.
Queries on large forms take a long time
Symptom: Queries on forms with many submissions are slow to return, or time out when the network is slow.
Best practices:
-
Use both date filters. When you filter by date, always send both
startDateandendDate(for example, 30-day windows). AstartDatewith noendDatemakes Logiforms count and scan records across the form's entire history. -
Page through results by ID. For large exports, request records in order with
startIDand sort by record ID. Lookups by record ID run much faster than page offsets.https://forms.logiforms.com/api/1.0/form/{form_id}/data?startID={last_seen_id}&sortBy=record_id&sortOrder=ASC
Requests fail with HTTP 429 Too Many Requests
Symptom: Automated scripts or data sync jobs fail with HTTP 429 Too Many Requests (Access throttled).
Cause: The Logiforms REST API allows 60 requests in 60 seconds.
Fix:
- When you loop through several pages of results, add a delay between requests instead of sending them all at once.
- When you get an HTTP 429 response, retry automatically with exponential backoff so the rate limit window can reset.
0 Comments