{"error":{"code":"Unauthorized","message":""}} while sending sms using ACS

Amardeep Sharma 0 Reputation points


I am trying to send SMS using CLI and c# application. Earlier it was working perfectly, then suddenly it stopped sending SMS and giving me

error in response while i am calling service. Error is :


Please help me to make it working.


Amar Deep Sharma

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
546 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 13,041 Reputation points

    Hi @Amardeep Sharma We are sorry to hear you're facing this issue. Did you make any recent changes to your C# app?

    The “Unauthorized” error you’re seeing typically means there is an issue with the authentication or permissions. Here are a few things you could check:

    1. Access Key: Ensure that the access key you’re using is correct and has the necessary permissions to send SMS messages. If you're using an API key for authentication, ensure that the API key is still valid and hasn't been revoked. If you're using a connection string, verify that it is correct and hasn't changed. It should include the necessary information for authentication.
    2. Check Azure Communication Services Resource Access:

    Ensure that your Azure Communication Services resource has the necessary permissions to send SMS messages. You might need to check and update the access policies or roles associated with your resource.

    1. Phone Number: Make sure that the phone number you’re using to send SMS messages is registered with the phone number capability sms:PhoneNumberCapabilityType.Outbound