Author Message
KyleHodess
Joined: Nov 17, 2015
Messages: 14
Offline
So, I'm trying to use the Bookings APIs in Office 365. Unfortunately, the only permissions available for Bookings are delegated, so I have to use a username and password as well as a client ID and secret.

I noticed this old post saying something should be added, but I'm on 3.8 and not seeing much around how to use O365 authentication.
https://www.devconnectprogram.com/forums/posts/list/23128.page#p158557

I can get a token in Postman if I HTTP POST to https://login.microsoftonline.com/MyTenantID/oauth2/v2.0/token
and if I pass in the body:
grant_type = password
client_id = myclientID
client_secret = mysecret
scope = https://graph.microsoft.com/.default
username = A user that can use MS Bookings
password = that user's password.

I can then use that auth token to do a HTTP GET on https://graph.microsoft.com/beta/bookingBusinesses/Bookingemailaddress@mytenant.onmicrosoft.com/appointments

And that gets me appointments.

I was trying to do a HTTP POST to the token endpoint with authentication "none" and just pass the parameters along in the payload, but the payload never seems to accept or take the client_id because it seems hard coded to expect that in the OAuth.

So, out of curiosity, anyone have any tips to authenticate against O365 with a rest call to do stuff?
KyleHodess
Joined: Nov 17, 2015
Messages: 14
Offline
Well, I got around Breeze doing the OAuth part by taking my token from Postman and adding it into the REST call I wanted to make not as a OAuth Token but as an additional Authorization header.

I guess cause I'll be running a database underneath anyway that I'll just rig a cron job to a curl script to refresh the token every so often and just make the REST calls read an auth header from the database instead of fighting with the authentication mechanisms in EDP's REST call
Krishnakumar(KK)
Joined: Jul 15, 2016
Messages: 34
Offline
Hi,
Have you tried "OAuth 2.0" option for http authentication? This option would either use the oAuth token if provided or try to get the OAuth token using the parameters you provide and use it for the http request.

If you have tried with this option and did not work, could please share the error you are getting?

Thanks!
Demarcus14528
Joined: Aug 2, 2021
Messages: 1
Offline
Since the data we want to retrieve from the Graph API is usually related to specific users, it only makes sense that we need to use Azure Active

NJMCDirect
Go to:   
Mobile view