Share via

HOW TO EXTRACT HTTP STATUS FROM GRAPH API

Giorgio Sfiligoi 371 Reputation points
Apr 14, 2025, 1:10 PM

When a Graph API encounters an error, how can I extract the HTTP status code in C#?

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

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 74,066 Reputation points
    Apr 14, 2025, 3:30 PM

    I assume use are using the graph sdk and not the rest api. See docs for getting the response code:

    https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/main/docs/errors.md


Your answer

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