Does anyone know the solution to this error message?

35 views
Skip to first unread message

Peter Zondervan

unread,
Feb 13, 2026, 3:25:16 AM (7 days ago) Feb 13
to Google Apps Script Community

Goodmorning,

I have started discovering Google Apps Script and am amazed by the infinite possibilities. I am quite new to programming and regularly call on 'Gemini' for help.

Recently, a script (which synced perfectly one-way between Google Calendar and Todoist) suddenly started giving error messages, as seen in the image. Gemini can't solve this, so I'm turning to 'humans.'

Does anyone recognize this message and where could the solution be found? 

Greetings, Peter.


and in Dutch,

Goedemorgen,

Ik ben begonnen met het ontdekken Google Apps Script, en sta vertelt van de oneindige mogelijkheden


ik ben vrij onbekend met programmeren en roep dan ook regelmatig de hulp van 'Gemini' in.

Zo krijg ik in een script (dat perfect 1 way syncte tussen Google agenda en Todoist) opeens foutmeldingen, zoals: zie afbeelding.


Gemini kan dit niet oplossen, dus ik wijk nu uit naar 'naar de mens'.


Kent iemand een dergelijke melding en waar zou de oplossing gevonden kunnen worden...


Groet Peter

Kildere S Irineu

unread,
Feb 13, 2026, 9:39:29 AM (6 days ago) Feb 13
to google-apps-sc...@googlegroups.com

Goedemorgen Peter,

Wat leuk om te lezen dat je enthousiast bent over Google Apps Script 😊
Een 1-way sync tussen Google Calendar en Todoist is al meteen een mooie (en niet eenvoudige) use-case.

Omdat je verwijst naar “zie afbeelding”, maar ik de foutmelding zelf hier niet zie, ga ik je eerst helpen met de meest voorkomende oorzaken bij dit soort scripts. 90% van de plotselinge fouten bij een werkende Calendar ↔ Todoist sync komt neer op één van deze vier punten:


🔎 1. OAuth / Toestemmingen verlopen

Als je script de Google Calendar API of de Todoist REST API gebruikt met een access token, dan is de kans groot dat:

  • het access token verlopen is

  • de refresh token niet meer geldig is

  • scopes gewijzigd zijn

  • de API opnieuw geautoriseerd moet worden

Typische foutmeldingen:

  • 401 Unauthorized

  • Invalid Credentials

  • Request had invalid authentication credentials

  • Exception: Access denied

✅ Oplossing

Ga naar:

Apps Script → Triggers → Verwijder trigger → opnieuw aanmaken

En voer daarna handmatig een functie uit zodat je opnieuw autorisatie krijgt.

Ook belangrijk:

function testAuth() { Logger.log(CalendarApp.getDefaultCalendar().getName()); }

Als dit al een fout geeft → dan zit het probleem in Google autorisatie.


🔎 2. Todoist API wijziging

Todoist heeft de afgelopen jaren meerdere API-wijzigingen doorgevoerd (v7 → v8 → REST v2).

Als je script iets doet als:

UrlFetchApp.fetch("https://api.todoist.com/rest/v2/tasks", options);

Controleer dan:

  • Gebruik je nog het juiste endpoint?

  • Is je API token nog geldig?

  • Staat je token correct in de headers?

Correct voorbeeld:

const options = { method: "post", headers: { "Authorization": "Bearer " + TODOIST_TOKEN, "Content-Type": "application/json" }, payload: JSON.stringify({ content: "Test taak", due_string: "tomorrow" }), muteHttpExceptions: true }; const response = UrlFetchApp.fetch("https://api.todoist.com/rest/v2/tasks", options); Logger.log(response.getResponseCode()); Logger.log(response.getContentText());

👉 Let op muteHttpExceptions: true — anders zie je de echte foutmelding niet goed.


🔎 3. Time-driven trigger probleem

Veel sync scripts draaien via:

ScriptApp.newTrigger("syncCalendar") .timeBased() .everyMinutes(15) .create();

Soms:

  • Trigger wordt automatisch uitgeschakeld

  • Quota limiet bereikt

  • Script exceeded maximum execution time

Controleer:

Apps Script → Executions → Bekijk rode errors


🔎 4. Google API quota of wijziging

Google verandert soms onderliggende API-validatie.

Bijvoorbeeld:

  • Exception: Service invoked too many times

  • Exceeded maximum execution time

  • Invalid argument: startTime

Controleer ook of je Advanced Services gebruikt:

  • Calendar API (Advanced Service)

  • Of gewoon CalendarApp


🎯 Wat ik van je nodig heb

Kun je hier exact de foutmelding plakken?

Bijvoorbeeld:

Exception: Request failed for https://api.todoist.com returned code 401

Of:

TypeError: Cannot read properties of undefined

De exacte tekst is cruciaal.


📌 Kleine snelle checklist voor jou

  1. Open Apps Script editor

  2. Ga naar Executions

  3. Klik op de laatste rode fout

  4. Kopieer de volledige error message

  5. Plak die hier


🧠 Extra tip voor stabiele sync scripts

Voor productie-waardige sync tussen Calendar en Todoist raad ik aan:

  • Gebruik PropertiesService om sync-IDs op te slaan

  • Gebruik LockService om dubbele runs te voorkomen

  • Gebruik batch verwerking i.p.v. per event calls

  • Log altijd response codes

Voorbeeld veilige logging:

function safeFetch(url, options) { try { const response = UrlFetchApp.fetch(url, options); Logger.log(response.getResponseCode()); return response; } catch (err) { Logger.log("ERROR: " + err.toString()); throw err; } }

Peter — geen zorgen 🙂
Dit soort “plotselinge” fouten zijn bijna altijd:

  • verlopen token

  • API wijziging

  • trigger issue


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/637de9af-3d9f-4fb8-b3fd-e5d2c9254b43n%40googlegroups.com.

Tim Dobson

unread,
Feb 13, 2026, 10:33:49 AM (6 days ago) Feb 13
to google-apps-sc...@googlegroups.com
 Hi Peter, I can't see the image that your error message is supposed to be in.

--

Peter Zondervan

unread,
Feb 13, 2026, 2:33:45 PM (6 days ago) Feb 13
to Google Apps Script Community
Hallo,
Dank voor de uitgebreide reactie.

De foutemelding die ik makkelijk kan reproduceren is:
20:25:59
Informatie
Fout bij verwerken event: Exception: Request failed for https://app.asana.com returned code 401. Truncated server response: {"errors":[{"message":"Not Authorized","help":"For more information on API status codes and how to handle them, read the docs on errors: https://de... (use muteHttpExceptions option to examine full response)
20:25:59
Informatie
Fout bij verwerken event: Exception: Request failed for https://app.asana.com returned code 401. Truncated server response: {"errors":[{"message":"Not Authorized","help":"For more information on API status codes and how to handle them, read the docs on errors: https://de... (use muteHttpExceptions option to examine full response)
20:25:59
Informatie
Fout bij verwerken event: Exception: Request failed for https://app.asana.com returned code 401. Truncated server response: {"errors":[{"message":"Not Authorized","help":"For more information on API status codes and how to handle them, read the docs on errors: https://de... (use muteHttpExceptions option to examine full response)
en dat vele, vele regels zo door.

Kan je hier wat mee?

(ik ben nieuw hier: moet ik in het Engels of in het Nederlands antwoorden?)

groet Peter
Op vrijdag 13 februari 2026 om 16:33:49 UTC+1 schreef Tim Dobson:

Tim Dobson

unread,
Feb 15, 2026, 10:21:22 AM (4 days ago) Feb 15
to google-apps-sc...@googlegroups.com
The problem is almost certainly (90%) something to do with how you're trying to auth with Asana. Either your keys and creds are wrong, or the shape of what you're sending it wrong, or something is wrong. 

Because you go to the castle gate and you say "Let me in" and Asana says "you got the password wrong".
So either you told the password to the wrong window, or the password is wrong, or you said it in the wrong language (encoding) etc.

Double check the asana docs - give the asana docs to gemini and you existing code and these errors and this email and ask it to fix it.

And if it works, tell me ;)

Reply all
Reply to author
Forward
0 new messages