Skip to main content

I'm trying to execute a simple API call to Fireberry:

 

 

 

const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
tokenid: '...'
},
body: JSON.stringify({accountname: 'Test'})
};

fetch('https://api.powerlink.co.il/api/record/account', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));

 

 

 


This exact call works in Make, but in Airtable it throws a 405 - 'Method not allowed'. It seems impossible to complete thi task without another tool like Make. Is there a fix / workaround?

Hi,
to be honest, I don't know the reason, and what such error means.
it helped me with my problem, so maybe worth a try.
add redirect option:

const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
tokenid: '...'
},
redirect: 'manual',
body: JSON.stringify({accountname: 'Test'})
};

Thanks @Alexey_Gusev , I have not yet test this solution but this will probably help someone in the future. Eventually I've ran the script inside an automation. This worked well and was accidentally a better fit to my Project.


Reply