- Integrate with Outlook API
- Get emails from Outlook inbox
Configuration config.json was created using AutoFlow version 0.2.9
Is you have questions about this example, feel free to post your question on the community "Ask Questions" website.
- HTTP Server
- Endpoint (Method: GET)
- Action communication/http-request to make the HTTP API call to Outlook and get the token
- Action json/decode to make the JSON easier to use and retrieve the token
- Action string/concatenate to join strings "Bearer" and "access_token"
- Action communication/http-request to get users by calling Microsoft Graph
- Action json/decode to make the JSON easier to use
- Action string/join to combine the values into an url
- Action communication/http-request to get the mail folders
- Action string/uri-url-encode to enconde "filter" as an url
- Action string/uri-url-encode to encode the email as an url
- Action string/join to create an url getting unread emails from inbox
- Action communication/http-request to get the emails from inbox
Here we want to call the Outlook API to get the Token. The returned data is stored in a new variable called "result"
Outlook returns the data in JSON format. We can use the json/decode action to put the retrieved Token in a more accessible format.
Use this action to join the strings "Bearer" and the "access_token". Output will be Bearer Token.
Here we call Microsoft Graph to get the profile of a specific user. The value is stored in a new variable called "users".
Outlook returns the data in JSON format. We can use the json/decode action to put the returned data in a more accessible format.
Join the results by using the action string/join. The result will be in the variable url.
Use the URL from the previous action to get access to the mail folders.
Use the srting/uri-url-encode for both the filter "isRead eq false" and the userPrincipal name (the user's email).
Use the action string/join to combine userPrincipalName and the Filter. The result will come in the variable "url".
Call the Outlook API with the variable "url". The result should be stored on the variable "messages."
For Additional help on Asana API: https://docs.microsoft.com/en-us/graph/auth-v2-service