Delete records in airtable

Has anyone met the problem of unable to use the delete request in airtable api? It says in the doc it’s urlencode. How to do that? And also I tried javascript. it reported the mistake ‘reference error: require is not defined’ and I think it’s from ‘var Airtable = require(‘airtable’);’. Does anyone have any solution.

Thanks,
Ricky

By the way, the reason why I cant attach the id to url is that I need to get id from user reply.

Airtable’s DELETE API for multiple records require data with url-encoded and those keys must be “records[]”.

Voiceflow’s API step supports DELETE request with URL encoded. but it seems key string does not accept some characters like ‘[’ and ‘]’ and remove it when requesting.

Airtable’s API seems there’s no other methods like JSON raw-data, so as far as I tried,
DELETE with url-parameters like this works.

https://api.airtable.com/v0/YOUR_BASE_ID/recipes?records[]=ID_YOU_WANT_TO_DELETE

I’ve not tried but for deleting multiple records, add more parameters after url like this:

https://api.airtable.com/v0/YOUR_BASE_ID/recipes?records[]=ID_YOU_WANT_TO_DELETE1?records[]=ID_YOU_WANT_TO_DELETE2

URL parameters might have max length limits in browser, web server, etc.

Thank you so much. I know it works in this way. But my problem is how to attach that ‘?records[]=ID_I_WANT_TO_DELETE’. I cannot simply type in this way

https://api.airtable.com/v0/BASE_ID/TABLE_NAME?records[]=ID

cuz that id may change every time

BTW,

it reported the mistake ‘reference error: require is not defined’ and I think it’s from ‘var Airtable = require(‘airtable’);’

in custom code block, you cannot import JS libraries with “require”.

instead, you can use “requirefromurl”.

I’ve not fully tried but seems some libraries works, some doesn’t (especially HTTP client such as Axios or HTTP did not work). so it depends on each library. If you are familiar with JS, you can try.