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

Amardeep Sharma 5 Reputation points
2023-11-17T09:46:23.0966667+00:00

Hi

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 :

{"error":{"code":"Unauthorized","message":""}}

Please help me to make it working.

Regards

Amar Deep Sharma

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,886 Reputation points
    2023-11-21T07:13:17.4966667+00:00

    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

    Best,

    Grace


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.