Facing InternalServerError while using user api of graph message in response is : Error processing response from backend service.

Anonymous
2024-02-02T10:48:39.39+00:00

Hi all, I am using a user API : https://graph.microsoft.com/v1.0/users?$select=country,companyName,city&$expand=contacts($select=jobTitle)
OR API : https://graph.microsoft.com/v1.0/users?$select=country,companyName,city&$expand=contacts getting

 "error": {
        "code": "InternalServerError",
        "message": "Error processing response from backend service."
}

I am attaching a screenshot of Postman on which I am facing the issue.
User's image

User's image

Queries:

  1. Please check if there is an error in the URL or query parameters.
  2. Why I am facing this issue and how can I fix it?
  3. Also when I am using API: https://graph.microsoft.com/v1.0/users?$select=country,companyName,city&$expand=extensions it is working fine and getting 200 ok status.

Could anyone help me with this?

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. Sourabh Gupta 805 Reputation points Microsoft External Staff
    2024-02-03T12:05:21.6+00:00

    Hi Vinay Sharma, Thanks for reaching out. There is nothing wrong either with the API or the query. Contacts property is only available for the users for whom the mailboxes are configured. Since you are using this query on all the users, there might be some users for which mailbox is not configured. Maybe you can try running the following query (There might be some users in the tenant for which mailbox is not setup like service accounts or conference rooms) https://graph.microsoft.com/v1.0/users/{user-id}/contacts In case it is not set up you will get the following error

    User's image

    If you will run the following query on beta endpoint. you will get to know that this feature will be removed in upcoming releases, and you will get the error message as in screenshot below. https://graph.microsoft.com/beta/users/{user-id}?$expand=contacts

    User's image

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

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.