Contact List Api Fail

Gautam Patel 20 Reputation points
2023-01-23T10:07:50.5466667+00:00

I want to get all contact But contact list api fail.

I Used "

https://graph.microsoft.com/v1.0/me/contacts

" this api throw this error " 401 Unauthorized "

And 2 nd I used " [https://graph.microsoft.com/v1.0/Contacts.Read "this api.

It 's getting this error. "Invalid request , 400 Bad Request"

I pass access token and all the necessary authentication.

But this api isn't working.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,964 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shivam Dhiman 5,866 Reputation points
    2023-01-23T22:57:05.88+00:00

    Hi @Gautam Patel
    I have tried this Graph API and it's working fine. Please refer to the below sample screenshot:

    contacts

    As you are getting 401 Unauthorized error, please make sure your token is valid. This error often means that the access token may be missing in the HTTP authenticate request header or that the token is invalid or has expired. Please refer to this documentation for more details. Please refer to this documentation for Authorization code flow.

    Also, as per the contacts Graph API documentation Contacts.Read, Contacts.ReadWrite permissions (from least to most privileged) is required, please make sure you have granted these permissions before running Contacts Graph.
    You can decode the token using **https://jwt.io/**and check permissions in your token.

    You are getting "Invalid request, 400 Bad Request" for this https://graph.microsoft.com/v1.0/Contacts.ReadGraph API
    because this is not valid Graph API. Please use the valid Graph API as per the documentation.
    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful