Hi, I am using Google Apps Script to set up a trigger which should runs the scenario in theory. However, when I run it, I see “502 Bad Gateway” error message on my make.com dashboard. Please check if the credentials format is correct.
https://eu2.make.com/api/v2/1234567/scenarios/7654321/run
is 1234567 = organization id ?
is 7654321 = scenario id ?
Bearer 90649e3ddd3e05f52f8759488653392b
function onFormSubmit(e) {
const url = 'https://eu2.make.com/api/v2/1234567/scenarios/1234567/run'; // Replace with your Make.com scenario URL
const options = {
method: 'post',
headers: {
'Authorization': 'Bearer 90649e3ddd3e05f52f8759488653392b', // Your actual Bearer Token
'contentType': 'application/json'
},
muteHttpExceptions: true
};
UrlFetchApp.fetch(url, options);
}
function setup() {
ScriptApp.newTrigger('onFormSubmit')
.forForm(FormApp.openById('ANjnG3nv8J_G1pO8PDSmYnaU224eeM9QU')) // Your form ID
.onFormSubmit()
.create();
}
Please use simple exact format like me with made up numbers. I don’t understand the API doc.