Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Register a http://localhost endpoint as a notificationUrl for webhook

1076 2
cancel
Showing results for 
Search instead for 
Did you mean: 
nisitkumar
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi,

I am trying to register my localhost rest API endpoint as a notification URL for the Airtable webhook. I am hitting a roadblock with the server sending the following response: 

[body] => {"error":{"type":"INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND","message":"Invalid permissions, or the requested model was not found. Check that both your user and your token have the required permissions, and that the model names and/or ids are correct."}}
[raw] => HTTP/1.1 403 Forbidden

Now my questions are:

1) Can we register our localhost endpoint as a notification URL?

2) I am using the pated below php code. Is it a problem with the code?

$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $airtable_api_key,
);

$body = wp_json_encode(
array(
'notificationUrl' => $webhook_url,
'specification' => array(
'options' => array(
'filters' => array(
'dataTypes' => array( 'tableData' ),
'recordChangeScope' => 'tblgR4tt66WVctY11',
),
),
),
)
);

$response = wp_remote_post(
$airtable_api_url,
array(
'headers' => $headers,
'body' => $body,
)
);

Looking forward to help.

Regards,

Nisit

 

2 Replies 2
Steve_Haysom
8 - Airtable Astronomer
8 - Airtable Astronomer

Try using ngrok.com to expose your localhost to the internet.

Thanks, Steve. I moved my setup to https and I was able to register the endpoint. I will soon test whether the Webhook is able to send my local endpoint changes made on the database. I will update this thread after that.

Regards,

Nisit