Hi @Umar khalid
You are granting application permissions, and the /me
endpoint only supports delegated permissions, and that's the problem.
You should use the daemon-based client credentials flow for application permissions, and then change the /me
endpoint to the /users/{user id}
endpoint, since user logins don't exist for application-only context.
If you want to call the /me
endpoint to access the Calendar API, you should grant delegated permissions to the calling app and then use the delegated authentication flow to obtain an access token, such as auth code flow or ROPC flow.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.