Access to Azure Communication service to send SMS via REST api failed: "Our services aren't available right now"

Mikhail Gryaznov 0 Reputation points
2024-09-21T16:40:14.1966667+00:00

The state is:

  1. "Communication Service" subscription to send SMS
    "Try SMS" on Azure portal works OK
  2. There are: {end point} and "primary key"
  3. Simple C# windows desktop app with .NET SDK runs OK and
    "SmsClient smsClient = new SmsClient(connectionString)"
    send SMS successfully
  4. Azure CLI running on Windows computer send SMS successfully with command line:
    az communication sms send --sender "+1888ddddddd" --recipient "+1dddddddddd" --message "Hello world" --connection-string "endpoint=https://biopac-sms-otp.unitedstates.communication.azure.com/;accesskey=..."

The goal:

  1. to develop C++ app that utilize Azure Communication Service via REST API by sending POST request to Azure service because there is no Azure SDK for C++
    https://learn.microsoft.com/en-us/rest/api/communication/dataplane/sms/send?view=rest-communication-dataplane-2021-03-07
  2. Running POST request from C++ windows app to the same {endpoint}+"primarykey" as C# example returns error.
  3. Tried to send POST request via PostMan utility and got error message:
    "<h2>Our services aren't available right now</h2><p>We're working to restore all services as soon as possible. Please check back soon.</p>0u/LuZgAAAADZpgZDPtx2Saux4t9VGuIIU04xRURHRTMxMDgARWRnZQ=="

But this is not true. C# windows app can send SMS via Azure Communication service

  1. POST request is:
    https://biopac-sms-otp.unitedstates.communication.azure.com/;accesskey=.../sms?api-version=2021-03-07
    Request's Body:
    { "from":"+1888ddddddd", "smsRecipients": [ { "to": "+1dddddddddd" }], "message":"Hello world", "smsSendOptions": { "enableDeliveryReport": true, "tag": "testSmsRequest"

}

}

What is wrong about "POST" request to Azure service?

Thanks,

Mikhail

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

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 21,506 Reputation points
    2024-09-23T07:29:52.95+00:00

    @Mikhail Gryaznov Thanks for asking question!

    We cannot directly access the endpoint as a rest API endpoint there are extensions to it that we need to add so that we can reach the correct destination like in order to place a call using Azure communication services we need to use this endpoint.

    {endpoint}/calling/callConnections?api-version=2021-08-30-preview

    FYI this will not work until you provide the access token. Please let us know if issue remains, happy to assist.

    0 comments No comments

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.