22-02-23 03:38 PM
We are attempting to implement the Microsoft Graph API for accessing a shared Outlook mailbox. Currently, I am attempting to use the List Messages action, and am getting the following error message (have tested other actions with a similar error): {"error":{"code":"InvalidAuthenticationToken","message":"Access token is empty.","innerError":{"date":"2023-02-22T15:07:56","request-id":"xxx","client-request-id":"xxx"}}}
However, we've confirmed that the authentication token is still active. We have the following API permissions set:
Mail.ReadWrite (Delegated)
Mail.ReadWrite.Shared (Delegated)
Mail.Send (Delegated)
Mail.Send.Shared (Delegated)
For the inputs, we're using the shared mailbox (full email address) as the mailbox ID.
Thank you in advance for any help you can provide.
06-03-23 02:39 PM
One more question for you that's popped up as we've been implementing - when trying to use List Mail in Folder for both Sent Items and Inbox, we're receiving the following error:
This occurs both when using the actual folder ID and the folder names of 'inbox' and 'sentitems'. This isn't happening with other folders from what we've observed so far. It looks like this is related to the JSON to Messages stage. Any ideas/suggestions for resolution?
Thanks!
Rachel
06-03-23 05:16 PM
I've seen a similar issue in the past. Previously, this came down to an issue where an element in the raw JSON returned by Microsoft wasn't being properly initialized by Graph which resulted in a data type exception later on when an a later message had the same element and it was initialized properly based on it's type (eq. null vs false for a Boolean value).
I'll see if I can recreate the condition you're seeing. Can you give me some broad details about the messages you're listing? Is there anything special about them? Are their attachments, voting results, etc? Any sort of special Outlook features being used in these?
Cheers,
Eric
06-03-23 05:33 PM
Thanks so much, @ewilson !
Nothing special about the messages - we're passing the mailbox, folder ID (for both inbox and sentitems) and number of results per page. We would ultimately like to apply a search query by subject line content, but priority at the moment is getting the response to return as expected first.
09-06-23 03:19 PM
we are also recieving the same error on "List Mail in Folder" page and the "JSON to Messages" code block throws : Unable to cast object of type 'Newtonsoft.Json.Linq.JValue' to type 'Newtonsoft.Json.Linq.JObject'.
looking at the raw json, the first entry for isDeliveryrecieptrequsted is :NUll so the column is still setting the type to string, and the second mail item has this set to false.
if i only get 1 item its fine also we re-imported 1.3.1 to see if maybe it was corrupt but seems like the fix isnt working
09-06-23 05:13 PM
found the issue for me, the isDeliveryRequested i forced all nulls to false with a replace step, but noticed i was still getting it. this time for the Categories field. if first one is blank like "categories": [], and a second one is "categories": ["For Review"], i get the same mismatch error. i tested removing "For Review" and it processed both as a collection. if categories is filled in then there is an error.
09-06-23 07:20 PM
It's unfortunate that Microsoft doesn't seem to understand how to properly initialize empty items in their JSON responses. 🤷♂️ We did add some code to handle the isDeliveryReceiptRequested issue. We can take a look and see if we can apply the same code change to the categories entry.
Cheers,
Eric
09-06-23 07:42 PM
Thanks @ewilson
I made a temp workaround to do a regex replace on categories since its not something we currently need but an updated version would be better!
11-04-24 02:41 PM
@ewilsonWanted to check if there was a solution to the categories issue yet? We're unable to read messages for the same reason above if categories exist.
11-04-24 03:47 PM
Hello @faisal.reza
Unfortunately, there's been no change in the handling of categories yet. It is in our backlog though.
Cheers,
Eric
11-04-24 04:17 PM
@faisal.reza I went back and reviewed changes to the VBO. This feature was actually introduced in the 1.3.2 release late last year. Are you using the latest release?