Hey guys
Has anyone successfully managed to call the Softr database API recently? I’m stuck.
The GET calls seem to work just fine and return a list of records or single records:
curl -X GET 'https://tables-api.softr.io/api/v1/databases/<MY-DATABASE-ID>/tables/<MY-TABLE-ID>/records/<MY-RECORD-ID>' \
-H 'Softr-Api-Key: <MY-API-KEY>'
Now when switching to a POST call, I only ever get “bad request” errors.
curl -X POST 'https://tables-api.softr.io/api/v1/databases/<MY-DATABASE-ID>/tables/<MY-TABLE-ID>/records/' \
-H 'Softr-Api-Key: <MY-API-KEY>' -d '{ "fields": { "<MY-FIELD-ID>": "test" } }'
Error message:
{"message":"Bad request","errorCode":"BAD_REQUEST","details":{"traceId":<MY-TRACE-ID>}}
I tried to setup the same call directly in Softr and configure an action button to call the API, then I get a slightly different error message:
{"message":"Invalid payload","errorCode":"UNKNOWN_FIELD","details":{"<MY-FIELD-ID>":"Unrecognized field in request payload"}}
I double and triple checked the field-id: It exists in the table I’m calling and it’s spelled correctly. I validated through a GET request and copy-pasted the field-ID from the response but still no luck.
I’m out of ideas on what to try. Any suggestions?