[GH-ISSUE #5657] [DOCS]: App intergration - what's missing #5222

Closed
opened 2026-06-05 14:52:45 -04:00 by yindo · 8 comments
Owner

Originally created by @ohromeo on GitHub (May 19, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5657

Description

Hi,

trying to review the gmail intergrations. followed the instructions to the tee, but continue to get un-authorzed messages, irregardless of gmail or calendar.
I go into my account and can see the connector has been authorized and also via the app script when i "ran" the applets

Image Image

I apologize, but I’m unable to access your Google Calendar data right now. The authorization to connect to your account isn’t available in this environment.

It appears there was an error listing your calendars. The 404 error typically means the Google Calendar API resource was not found. This could be due to authentication issues, the service not being properly enabled, or the endpoint being incorrect.

I recommend:

Checking that the Google Calendar API is enabled in your Google Cloud project.
Verifying your authentication credentials are valid and have the necessary scopes (like https://www.googleapis.com/auth/calendar.readonly).
Ensuring you’re using the correct API endpoint (e.g., https://www.googleapis.com/calendar/v3/users/me/calendarList).

If you can provide more details about how you’re trying to access this (e.g., via a specific library or direct API call), I can help troubleshoot further.

It sounds like your Gmail access token is either expired or invalid. Try re-authenticating or refreshing your credentials. If you’re using a connected service (like Zapier, OAuth app, or a script), make sure:

Your OAuth 2.0 credentials have the correct scope: https://www.googleapis.com/auth/gmail.readonly (or a broader scope if needed).
The token has not been revoked.
You are passing a valid access_token in the Authorization header.

I have read the docs 100 times, i just can't see what i'm missing...
on docker or desktop, behaving similarly..

Thanks

Originally created by @ohromeo on GitHub (May 19, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5657 ### Description Hi, trying to review the gmail intergrations. followed the instructions to the tee, but continue to get un-authorzed messages, irregardless of gmail or calendar. I go into my account and can see the connector has been authorized and also via the app script when i "ran" the applets <img width="602" height="189" alt="Image" src="https://github.com/user-attachments/assets/116dc7ee-44f5-46f4-a560-ac1e95e909bb" /> <img width="586" height="157" alt="Image" src="https://github.com/user-attachments/assets/c2cc8a14-9e44-45d3-b09c-34551a2004aa" /> I apologize, but I’m unable to access your Google Calendar data right now. The authorization to connect to your account isn’t available in this environment. It appears there was an error listing your calendars. The 404 error typically means the Google Calendar API resource was not found. This could be due to authentication issues, the service not being properly enabled, or the endpoint being incorrect. I recommend: Checking that the Google Calendar API is enabled in your Google Cloud project. Verifying your authentication credentials are valid and have the necessary scopes (like https://www.googleapis.com/auth/calendar.readonly). Ensuring you’re using the correct API endpoint (e.g., https://www.googleapis.com/calendar/v3/users/me/calendarList). If you can provide more details about how you’re trying to access this (e.g., via a specific library or direct API call), I can help troubleshoot further. It sounds like your Gmail access token is either expired or invalid. Try re-authenticating or refreshing your credentials. If you’re using a connected service (like Zapier, OAuth app, or a script), make sure: Your OAuth 2.0 credentials have the correct scope: https://www.googleapis.com/auth/gmail.readonly (or a broader scope if needed). The token has not been revoked. You are passing a valid access_token in the Authorization header. I have read the docs 100 times, i just can't see what i'm missing... on docker or desktop, behaving similarly.. Thanks
yindo added the documentationneeds info / can't replicate labels 2026-06-05 14:52:45 -04:00
yindo closed this issue 2026-06-05 14:52:45 -04:00
Author
Owner

@timothycarambat commented on GitHub (May 19, 2026):

When you deploy the GMail/Calendar app script it will ask to authorize all the API calls it could possibly use in the script. Did you not see that prompt? It typically happens right when you click deploy for the first time for the GApp Script

<!-- gh-comment-id:4492440306 --> @timothycarambat commented on GitHub (May 19, 2026): When you deploy the GMail/Calendar app script it *will ask* to authorize all the API calls it could possibly use in the script. Did you not see that prompt? It typically happens right when you click deploy for the first time for the GApp Script
Author
Owner

@labrat1984 commented on GitHub (May 19, 2026):

I am getting the same problem (403 errors). I have enabled the Agent Skill for reading gmail following the instructions (i.e., copy paste google apps script, generate and paste in API Key, insert deployment id and web app URL). I am getting 403 errors. I've waited a couple hours for the authentication to start working. Something is wrong.

<!-- gh-comment-id:4492522850 --> @labrat1984 commented on GitHub (May 19, 2026): I am getting the same problem (403 errors). I have enabled the Agent Skill for reading gmail following the instructions (i.e., copy paste google apps script, generate and paste in API Key, insert deployment id and web app URL). I am getting 403 errors. I've waited a couple hours for the authentication to start working. Something is wrong.
Author
Owner

@ohromeo commented on GitHub (May 19, 2026):

yes.. i believe so...
LLM: Generic-openAI - deepseek-chat
.gs script pulled from ALLM git as noted in docs..

let me know if you need anything else Tomothy.

Image Image

returns with the links & key..

in Gmail:

Image

Test:

Image Image Image
<!-- gh-comment-id:4492594613 --> @ohromeo commented on GitHub (May 19, 2026): yes.. i believe so... LLM: Generic-openAI - deepseek-chat .gs script pulled from ALLM git as noted in docs.. let me know if you need anything else Tomothy. <img width="345" height="227" alt="Image" src="https://github.com/user-attachments/assets/54a03f7f-dfe3-4925-84c6-09170232a5a9" /> <img width="522" height="252" alt="Image" src="https://github.com/user-attachments/assets/35ec4a72-ee4d-46a6-9e84-4219a9ad61d2" /> returns with the links & key.. in Gmail: <img width="1168" height="491" alt="Image" src="https://github.com/user-attachments/assets/93467ed3-292c-4479-80f8-d5b3ad911925" /> Test: <img width="795" height="275" alt="Image" src="https://github.com/user-attachments/assets/9beeb865-743d-49a0-a0f4-bd1ec14d8f08" /> <img width="803" height="582" alt="Image" src="https://github.com/user-attachments/assets/f2e7109a-d3da-4f82-a014-d905fff1b665" /> <img width="852" height="602" alt="Image" src="https://github.com/user-attachments/assets/845f7b80-ffd3-4ea9-b935-9e5e62b5f6ce" />
Author
Owner

@timothycarambat commented on GitHub (May 19, 2026):

So it sounds like at first it was a 404 because it was just deployed, now it is a 403 - which means that something else is wrong.

First, do you have the script executing as "only me" or "Anyone" - this would cause a 403

Image

If you click on the webURL - it should open a new tab and show a blank page with "no method doGet"

Then you can try this:
My API key for this deployment is const API_KEY = "SAMPLE"; when i saved and deployed

Then ran this in terminal:

curl --location 'https://script.google.com/macros/s/AK...123/exec' \
--header 'Content-Type: application/json' \
--header 'X-AnythingLLM-UA: AnythingLLM-Gmail-Agent/1.0' \
--data '{"action": "version",  "key": "SAMPLE"}'

and I get a successful result! Anything else or key missing and I get a 403 - so it sounds like the API key is not saved? Not knowing what the API key is like assuming its simple text - can you try temporarily using a more simple API key? I wonder if maybe there is some encoding issue or something with why it rejects your API key when sending the request.

To me, there seems like a bug with how the key is stored/decoded or something since its likely you copy/pasted the key right into the UI

<!-- gh-comment-id:4492600480 --> @timothycarambat commented on GitHub (May 19, 2026): So it sounds like at first it was a 404 because it was just deployed, now it is a 403 - which means that something else is wrong. First, do you have the script executing as "only me" or "Anyone" - this would cause a 403 <img width="766" height="605" alt="Image" src="https://github.com/user-attachments/assets/9fbc6fa0-b7e6-4d9b-a464-58e5548a90ff" /> If you click on the webURL - it should open a new tab and show a blank page with "no method doGet" Then you can try this: My API key for this deployment is `const API_KEY = "SAMPLE";` when i saved and deployed Then ran this in terminal: ```bash curl --location 'https://script.google.com/macros/s/AK...123/exec' \ --header 'Content-Type: application/json' \ --header 'X-AnythingLLM-UA: AnythingLLM-Gmail-Agent/1.0' \ --data '{"action": "version", "key": "SAMPLE"}' ``` and I get a successful result! Anything else or `key` missing and I get a 403 - so it sounds like the API key is not saved? Not knowing what the API key is like assuming its simple text - can you try temporarily using a more simple API key? I wonder if maybe there is some encoding issue or something with why it rejects your API key when sending the request. To me, there *seems* like a bug with how the key is stored/decoded or something since its likely you copy/pasted the key right into the UI
Author
Owner

@labrat1984 commented on GitHub (May 19, 2026):

My issue is not resolved. I had to re-deploy and re-authorize with Google. Thanks.

<!-- gh-comment-id:4492907868 --> @labrat1984 commented on GitHub (May 19, 2026): My issue is not resolved. I had to re-deploy and re-authorize with Google. Thanks.
Author
Owner

@ohromeo commented on GitHub (May 19, 2026):

Ok, tim made headway....

i flipped to another gmail account and both gmail and calendar fired up.
i checked the sqllite DB and the key was written correctly as yours "SAMPLE"
(i also manually typed in into the field)

now the only thing is.... what is the difference
i'll have to do some resteps for you..

in terms of the addressess:

not working: peter.paul.xxxxxxx@gmail.com
worked: singleWord@gmail.com

api key not working?: complex
api key worked: simple (letters only)

Let me delete everything and strat from scratch

<!-- gh-comment-id:4492929545 --> @ohromeo commented on GitHub (May 19, 2026): Ok, tim made headway.... i flipped to another gmail account and both gmail and calendar fired up. i checked the sqllite DB and the key was written correctly as yours "SAMPLE" (i also manually typed in into the field) now the only thing is.... what is the difference i'll have to do some resteps for you.. in terms of the addressess: not working: peter.paul.xxxxxxx@gmail.com worked: singleWord@gmail.com api key not working?: complex api key worked: simple (letters only) Let me delete everything and strat from scratch
Author
Owner

@timothycarambat commented on GitHub (May 19, 2026):

Its almost certainly not address related at all. Has to be with the API Key, i wonder if maybe there is some newline on paste or something that is making its way in or being encoded weird. Did you non-working API key have any kind of special chars? !@#$%^&*()~ or something like those?

<!-- gh-comment-id:4493206378 --> @timothycarambat commented on GitHub (May 19, 2026): Its almost certainly **not** address related at all. Has to be with the API Key, i wonder if maybe there is some newline on paste or something that is making its way in or being encoded weird. Did you non-working API key have any kind of special chars? `!@#$%^&*()~` or something like those?
Author
Owner

@ohromeo commented on GitHub (May 19, 2026):

looks like any changes to the api_keys or otherwise were not being applied, not sure if this was due to "after the fact changes"...

ended up deleting the script/project, removed the authorization from gmail.
recreated the sript with key, new deployment depoloyed, authorized
set ID/key in ALLM

original account is now working.

<!-- gh-comment-id:4493285631 --> @ohromeo commented on GitHub (May 19, 2026): looks like any changes to the api_keys or otherwise were not being applied, not sure if this was due to "after the fact changes"... ended up deleting the script/project, removed the authorization from gmail. recreated the sript with key, new deployment depoloyed, authorized set ID/key in ALLM original account is now working.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5222