Outlook add-in request search messages via API

Roy Ben Aviv 1 Reputation point
2022-09-12T12:42:43.357+00:00

Hello,

I have an add-in for outlook (usage for both desktop and web), and I am trying to make a simple call for searching outlook messages.
Now, I've tried to look for anything that can do that in the 'Office' object (https://learn.microsoft.com/en-us/javascript/api/office?view=outlook-js-preview)
Unfortunately, I did not find any method that can possibly do that.

The only thing I've found is making a post request and receiving back the messages in a response (https://learn.microsoft.com/en-us/graph/search-concept-messages)
I did not figure out how to use this, because I don't know how to reach the access token. I tried using Office.auth.getAccessToken but I'm getting back an error 13000.

Is there a simple way to do a search request?
How can I get the access token with the Outlook add-in application?

Thank you in advance,
Roy

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,657 questions
0 comments No comments
{count} votes