You need the app to create a Client Secret and you can set the permissions there e.g. Mail.Read.
http://codematters.tech/getting-access-token-for-microsoft-graph-using-oauth-rest-api/The job calls the Microsoft Graph API (not Automic REST API) via invoke-RestMethod e.g.
https://graph.microsoft.com/v1.0/me/messagesMy Powershell script to check the inbox for unread mails. Only the columns id,subject,from,hasAttachments are displayed. And $count=true counts the mails.
$url = "https://graph.microsoft.com/v1.0/users/&userid#/mailFolders/inbox/messages"
$token = '&token#'
$params = @{
Uri = 'https://graph.microsoft.com/v1.0/users/&userid#/mailFolders/inbox/messages?$filter=isRead+eq+false&select=id,subject,from,hasAttachments&$count=true'
Headers = @{ 'Authorization' = "Bearer $token" }
Method = 'GET'
ContentType = 'application/json'
Proxy = 'http://proxy:ip'
}
$messages = Invoke-RestMethod @params
I process the result in the Post-Script.
------------------------------
Mast-Jägermeister SE
------------------------------
Original Message:
Sent: 07-10-2019 03:51 AM
From: Joel Wiesmann
Subject: Microsoft Graph API
So you built an app in the azure cloud which handles the events raised by O365 if, for example, a new mail arrives? Then the app is forwarding the data to the Automic REST API?
------------------------------
Swisscom & WorkflowCommander
Original Message:
Sent: 06-28-2019 01:59 AM
From: Stefan Rieger
Subject: Microsoft Graph API
Hi,
not really nice yet, but it's working now. :) I use Invoke-RestMethod with Powershell.
You have to create an APP in the Azure Cloud. With the Client ID and the Secret of the App and the Directory ID you can create an Access Token (expires after 3600s).
The configuration of the proxy and the permissions of the app were the biggest problems.
I can give you more details next week. At the moment I don't have much time because the jobs have to be finished ;)
Best regards
Stefan
------------------------------
Mast-Jägermeister SE
Original Message:
Sent: 06-27-2019 10:06 AM
From: Joel Wiesmann
Subject: Microsoft Graph API
I'm planning to dive into that topic somewhen in the next few weeks. All I know so far is that you need an API key. So far I'm not sure whether I'll go for PowerShell or the Webservice object to implement the logic. If you're getting any result I'll be glad to hear about ;-).
Original Message:
Sent: 06-25-2019 06:16 AM
From: Stefan Rieger
Subject: Microsoft Graph API
Hi,
does anyone have experience with the Microsoft Graph API?
I would like to retrieve an Outlook 365 mailbox automatically with Curl and Automic.
Best regards
Stefan