I have tried two different APIs from different articles as shown below.
API 1
This API is working and token is getting generated.
Then in next part of API I am using generated token to fetch data:
But it is giving following error as shown in screenshot also.
{
"error": {
"code": "AuthorizationFailed",
"message": "The client '**************' with object id '**************' does not have authorization to perform action 'Microsoft.Web/sites/read' over scope '/subscriptions/**************' or the scope is invalid. If access was recently granted, please refresh your credentials."
}
}
API 2
But in this API, even token is not getting generated and giving following error
{
"error": "invalid_request",
"error_description": "AADSTS901002: The 'resource' request parameter is not supported. Trace ID: ************ Correlation ID: ************ Timestamp: 2023-12-28 07:17:52Z",
"error_codes": [
901002
],
"timestamp": "2023-12-28 07:17:52Z",
"trace_id": "************",
"correlation_id": "************"
}
I searched but couldn’t find the solution. I want to fetch data from Azure active directory via Rest API. But that doesn’t seems to be working.