I’m using @mzur 's wonderful Uniform plugin to create a fairly long form for people to register for an event. There’s about 16 fields, and potential for many registrants, so I’m trying to pull all submissions into a spreadsheet using something like Airtable or Google Sheets.
I’m a bit new to all this, so I’m not sure the best way to go about it.
Airtable provides a CURL API example, but I’m not sure how to translate that into using the Uniform actions.
Any help would be much appreciated!
My current code:
if (r::is('POST')) {
$form
->webhookAction([
'url' => 'https://api.airtable.com/v0/[AIRTABLE_ID]/[SHEET]',
'json' => true,
'params' => [
'method' => 'POST',
'headers' => ['Authorization: Basic key1234567890-'],
],
]);
}
Here’s what Airtable provides as an example:
$ curl -v -XPOST https://api.airtable.com/v0/[AIRTABLE_ID]/[SHEET] \
-H "Authorization: Bearer [APIKEYHERE]" \
-H "Content-type: application/json" \
-d '{
"fields": {
"name": "John Smith",
"cabin-type": "Interior",
"bed-config": "King",
"handicap": "no",
"wheelchair": "no",
"street-address": "123 Main St",
....
}
}'
Alternatively, could I somehow show all submissions in the Kirby admin Panel?