Asked by Thomas on March 7, 2025
When an external HTTP call fails I only see a generic status error (e.g., {"error":"Request failed with status code 400"}). Is there a way to view the full external response and log the exact request payload for debugging?
Answered by Twidget
External response details are controlled by the external API server — we surface what the server returns. Regarding logging request payloads, Twidget avoids storing full request logs that could contain sensitive data. If you need more debugging detail, let us know which specific response fields or request diagnostics would help and we can consider options to make debugging easier while protecting sensitive information.
Using variables in HTTP request headers and JavaScript support
Set the HTTP Request headers field to an object and add keys such as Content‑Type and Authorization. For Authorization, set the field to Variable and concatenate the prefix and key (for example: 'Bearer' + $global.apiKey) or use the platform’s variable expression to build the header value.
...
Locating Swagger documentation
The Swagger (OpenAPI) documentation is available on the API page in your Twidget environment.
Making a field required in a POST request
Use the Validate commands to check that the field exists and throw an error if it does not. This will return a non‑200 response and prevent the record from being created. See the validate tutorial: https://www.youtube.com/watch?v=FAbQP37ImUI&pp=0gcJCU8JAYcqIYzv
Querying by non‑ID fields returning no results
Quoted field names refer to table fields correctly. If you are testing in the API Client or the endpoint test, make sure Live Data is enabled to see actual records rather than mock data.
Retrieving related data across tables (example with managers and employees)
One approach: keep company_id and manager_id fields on the Employee table. Use Get Multiple Data filtered by company_id to fetch employees, then for each employee fetch the manager by manager_id (this results in multiple calls).
For better efficiency: perform a single Get Multiple Data to f...