1

I'm trying to create a 'POST' request to the IFTTT webhook service.
Using:

function deleteRow(ID){
    $.ajax({
    type: 'POST',
    url: 'https://maker.ifttt.com/trigger/delete_row/with/key/{key}',
    data: '{"value":"'+ID+'"}',
    contentType: "application/json",
    dataType: 'json'
});
}

Response:

Failed to load https://maker.ifttt.com/trigger/delete_row/with/key/{key}: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '{mysite}' is therefore not allowed access.

Whats wrong with my request?

George
  • 73
  • 4
  • 15
  • What is `{key}` supposed to be in the url? And where should it come from in the javascript? – charlietfl Apr 29 '18 at 20:07
  • Key is my personal key which I received from IFTTT. – George Apr 29 '18 at 20:09
  • OK. Then that API is not CORS enabled. Check if it serves JSONP, or requires special params in url for ajax or use a proxy on your server to communicate with the remote api. Not all API's are ajax accessible, often to protect credentials being put in browser – charlietfl Apr 29 '18 at 20:10
  • Tried JSONP and solved my problem – George Apr 29 '18 at 20:37
  • 2
    @George can you please tell me how did you solve it with `JSONP`? Feel free to answer your own question... Thanks! – Mars Robertson May 01 '19 at 16:17

0 Answers0