Getting 401 Unauthorized code when accessing Azure Communication Services API with bearer token

01DT 11 Reputation points
2022-10-05T21:07:55.893+00:00

Hello,

I want to access an Azure Communications Service API using Postman. I am trying to hit the endpoint:

POST {endpoint}/identities/{id}/:issueAccessToken?api-version=2022-06-01  
 

where {endpoint} is my ACS endpoint and {id} is the identity generated for voip calls in the User Access Token & Identities blade in Azure.

Header:

247902-header.jpg

My request body:

{  
    "scopes": [  
        "voip"  
    ]  
}  

HTTP Response code: 401 Unauthorized

Response body:

{  
    "error": {  
        "code": "Denied",  
        "message": "Denied by the resource provider."  
    }  
}  

I have been following:
https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow

From my understanding, I need to have a bearer token for authentication. I have been able to obtain the bearer token via testing in Postman using information from my Service Principal.

That Service Principal has permission to access my resource group.
It also has API permissions to access Azure Communication Services.
The Communication Service, through Access Control, has given the service principal a role.

What do I need to do to be able to access this API? Thanks.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
709 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,022 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Evgeny Duka 0 Reputation points
    2023-04-14T09:21:03.32+00:00

    Experiencing the same like above with sending email through REST API.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more