Webhook to Google Sheet from Trello

245 views
Skip to first unread message

Dmitriy Brilyov

unread,
Mar 27, 2023, 3:24:12 PM3/27/23
to Google Apps Script Community

I want to connect webhook to google sheet via google apps script. Previously, it helped to set up the deployment of a web application for everyone runing and the webhook was connected. Now throws an error.

{ "message": "URL (https://script.google.com/macros/s/.../exec) did not return 200 status code, got 302", "error": "VALIDATOR_URL_RETURNED_ERROR" }

Code to connect i use before:

let webAppUrl = "https://script.google.com/macros/s/.../exec"; 
let spreadSheetId = "..."; 
let trelloKey = "..."; 
let trelloToken = "..."; 
let trelloBoard = "..."; // Board 

function setWebhookTrello() { 
     let data = 
          { 
                    'key': trelloKey, 
                    'token': trelloToken, 
                    'callbackURL': webAppUrl, 
                    'idModel':     trelloBoard, 
          }; 
     const params = 
          { 
                    'method': 'POST', 
                    'contentType': 'application/json', 
                    'payload': JSON.stringify(data) 
           } 
     UrlFetchApp.fetch('https://api.trello.com/1/webhooks?', params); 
}

When i try to connect webhook with another URL (like https://webhook.site/) - working correct

I see this - How to create webhook from Google Apps Script using the "exec" url rather than "dev" url. Exec returns 403 Error but now it dont work =(

Alex

unread,
Mar 29, 2023, 8:45:25 AM3/29/23
to Google Apps Script Community
Там же по-русски написано, что ожидается 200, а ваш код возвращает 302. Попробуйте в doPost просто вернуть return без ничего.


function doPost(e){
  ...
  return;

Dmitriy Brilyov

unread,
Mar 29, 2023, 9:43:34 AM3/29/23
to Google Apps Script Community
Не помогает. Раньше для того чтобы подключить вебхук с трелло в таблицу необходимо было деплоить проект с выполнением для всех и доступом по гугл акк. У меня так работают уже 2 доски с таблицами, но в них вебхук прокидывался в том году. Сейчас не выходит никак

среда, 29 марта 2023 г. в 15:45:25 UTC+3, Alex:

Alex

unread,
Mar 29, 2023, 11:22:51 AM3/29/23
to Google Apps Script Community
Странно. Но ошибка про редирект, это точно. Попробую позже посомтреть

Loy Fsn

unread,
Mar 31, 2023, 5:06:04 AM3/31/23
to Google Apps Script Community
Me Too Any one can help 

Dmitriy Brilyov

unread,
Apr 21, 2023, 4:00:41 AM4/21/23
to Google Apps Script Community
Не было времени проверить? Ошибка так и осталась и где искать ответ неизвестно

среда, 29 марта 2023 г. в 18:22:51 UTC+3, Alex:

Alex

unread,
May 9, 2023, 1:01:15 PM5/9/23
to Google Apps Script Community
The first thing I see is that Trello is not sending any request to the web service. Interestingly, for me, he writes a 403 error, which means access is denied, and not a 302 redirect.

{
  "message": "URL (https://script.google.com/macros/s/ZZZ/exec) did not return 200 status code, got 403",
  "error": "VALIDATOR_URL_RETURNED_ERROR"
}

Dmitriy Brilyov

unread,
Jun 14, 2023, 4:38:59 PM6/14/23
to Google Apps Script Community
Раньше работал этот способ (https://digitalinspiration.com/docs/file-upload-forms/authorize-legacy), но видимо у гугла что-то изменилось по безопасности и теперь непонятно как стороннему приложению в виде вебхука дать доступ. 
Хотя при этом вебхук с телеграмом при деплое с параметрами "Запуск от имени: От моего имени, У кого есть доступ: Все" отлично работает

вторник, 9 мая 2023 г. в 20:01:15 UTC+3, Alex:
Reply all
Reply to author
Forward
0 new messages