last day (17 days later) » 

07:34
0
Q: Microsoft Graph API Get my Events api not working

Nilesh Daldraon miscrosoft graph api they provide v1.0 and v2.0 with v1.0 we used code as they provided on doc, but it does not work and we are not able to access token. and everywhere they just mentioned all apis that are in v1.0 there is no example of adding calendar event with v2.0. infect i have used thei...

Could you include how you generated the access token? What grant_type you used to get token?
Ya sure. updting those details on question wait
@Sridevi i have updated question with detail
Are you using personal Microsoft account like Outlook?
@Sridevi yes. one of my account i have registered with outlook which is from gmail
In Portal, what account type you selected while registering Azure AD application?
07:34
Hi
Hi
i.imgur.com/HQevpei.png What you selected here
Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant)
You need to select 3rd option that allows personal Microsoft accounts
prnt.sc/tt7b3mSY4aAO this options it showing me right now
Could you try creating new application selecting 3rd option?
07:36
Ya sure let me try that as well. wait just 2 minutes and thanks for your help i am creating new app
Sure
While getting code and access token, use /common instead of tenant ID
ok trying that
now getting this error
used this ones
https://login.microsoftonline.com/common/oauth2/authorize
https://login.microsoftonline.com/common/oauth2/v2.0/token
may be its happen as i have enabled 2fa code to login?
Not sure but usually 2fa should also work. Did you try running same query in Graph Explorer?
yes
on graph explorer its working but its token is different than we are getting
In Graph Explorer, you signed in with same Outlook account?
07:58
Yes, your access token must start with Ewc while using personal Microsoft accounts. Then only access token is valid and it will work
ok now our access token is starting from eyJ0e
can you please help me on this?
i am trying to do this from last 4 days but still not get it done
Could you decode that access token in jwt.ms website and include claims here?
Could you confirm whether you got code value starts with M.C51 when you ran authorization request?
@Sridevi the authorization code?
prnt.sc/Hts1rbgGQ03m no its showing somethig like this
08:09
Then it's not correct
my url is something like this

$url="https://login.microsoftonline.com/common/oauth2/authorize?client_id=$row_comp->ol_client_id&response_type=code&redirect_uri=$url_auth&response_mode=query&scope=api://$row_comp->ol_client_id/Calendars.ReadWrite%20offline_access&state=12345";
When you login with personal Microsoft account, you should get code like this i.imgur.com/K0O418F.png
Use this `https://login.microsoftonline.com/common/oauth2/v2.0/authorize
?client_id=appId
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=Calendars.Read
&state=12345`
ok trying this one
 
3 hours later…
10:52
i am trying it right now. i system was crashed
 
3 hours later…
13:24
Please do let me know if it works and consider accepting the answer by clicking the checkmark beside it and upvote if it's helpful for you in any way.
 
1 hour later…
14:43
@Sridevi ya sure. can you please show me where i can find appid?
15:14
You can find it in app registration's Overview page named Application (client) Id.

  last day (17 days later) »