yoanbernabeu / Airtable-Client-Bundle

Simple Client for Airtable API
MIT License
33 stars 12 forks source link

Create news records #11

Closed yoanbernabeu closed 3 years ago

yoanbernabeu commented 3 years ago

Set up the creation of a new record.

Airtable provides us with the following documentation.

EXAMPLE REQUEST (with Curl) curl -v -X POST https://api.airtable.com/v0/YOUR_BASE_ID/YOUR_TABLE \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ --data '{ "records": [ { "fields": { "fields1": "lorem ipsum", "fields2": "lorem ipsum", "RELATION_OTHER_TABLE": [ "ID" ] } }, { "fields": { "fields1": "lorem ipsum", "fields2": "lorem ipsum", "RELATION_OTHER_TABLE": [ "id" ] } }, ] } '

To create new records, issue a POST request to the news endpoint.

Your request body should include an array of up to 10 record objects. Each of these objects should have one key, fields, which contains all of your record's cell values by field name. You can include all, some, or none of the field values.

Returns an array of record objects created if the call succeeded, including record IDs which will uniquely identify the records within your table.