cancel
Showing results for 
Search instead for 
Did you mean: 

Issues Implementing MS Graph Outlook VBO

RachelAbbott
Level 3

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.

19 REPLIES 19

RachelAbbott
Level 3

@ewilson 

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:

35366.png

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

ewilson
Staff
Staff

Hi @Rachel Abbott

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

RachelAbbott
Level 3

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.

PhilipDeveau
Level 3

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 

PhilipDeveau
Level 3

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. 

ewilson
Staff
Staff

@PhilipDeveau 

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

PhilipDeveau
Level 3

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!

faisal.reza
Level 3

@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.

Hello @faisal.reza 

Unfortunately, there's been no change in the handling of categories yet. It is in our backlog though.

Cheers,

Eric

ewilson
Staff
Staff

@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?