Azure Communications Service SMS SDK Issue

Jim Miller 1 Reputation point
2021-09-03T19:56:02.893+00:00

All of a sudden I've just started getting this error when i call the SMS communication service with this:

SmsSendResult sendResult = await client.SendAsync(object);

Haven't used it in a week or so, just updated the Nuget package which didn't appear to do anything.

{"Service request failed.\r\nStatus: 401 (Unauthorized)\r\n\r\nContent:\r\n{\"error\":{\"code\":\"Denied\",\"message\":\"Request was out of the allowed time difference.\"}}\r\n\r\nHeaders:\r\nTransfer-Encoding: chunked\r\nRequest-Context: REDACTED\r\nMS-CV: REDACTED\r\nX-Processing-Time: REDACTED\r\nX-Cache: REDACTED\r\nX-Azure-Ref: REDACTED\r\nDate: Fri, 03 Sep 2021 19:35:14 GMT\r\nContent-Type: application/json\r\n"}

I'm assuming something is going on with the service at this point.

Any insights are appreciated.

Thanks,
Jim

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
675 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Grmacjon-MSFT 15,606 Reputation points
    2021-09-20T23:39:47.763+00:00

    Thank you so much for the update @Jim Miller . Glad the data is now showing up.

    Can you please provide the below details so we can provide the right solution for you. You can send this information to us offline by emailing usat azcommunity@microsoft.com with the subject "ATTN: Grace" :

    1. Your ACS resource endpoint URL which you're using to send SMS
    2. Are you still getting 401 error or different error when sending SMS?
    3. Are you facing issue receiving SMS event to their Event Hub resource or some other issue?

    Some helpful link which shows how to setup EventHub and receive event from Event Hub:
    Event Hubs - Capture streaming events using Azure portal - Azure Event Hubs | Microsoft Learn
    Send or receive events from Azure Event Hubs using .NET (latest) - Azure Event Hubs | Microsoft Learn

    We hope to hear back from you soon.

    Best,
    Grace

    0 comments No comments

  2. Md Rahatur Rahman 1 Reputation point
    2021-10-25T11:17:15.147+00:00

    Getting the same "Request was out of the allowed time difference" 401 error for the Communication Service resource


  3. Pavel Andreev 0 Reputation points
    2023-12-19T16:02:30.7133333+00:00

    Same issue with Australia Phone - 401 Unauthorized on attempt to send sms.

    Is there a solution or explanation? No clue what is going on. Email could be sent easily, but despite the acquired Australian Phone Number - 401 on SMS Send via SMS SDK

    Any update?

    0 comments No comments

  4. Charles G 0 Reputation points
    2023-12-27T15:15:01.39+00:00

    Are you seeing this error in WSL?

    WSL has a known issue where the clock falls out of sync with the system clock and it can cause errors.

    https://github.com/microsoft/WSL/issues/10006

    I had a similar error when sending emails from WSL. Restarting WSL solved the problem.

    Close all wsl instances, then in powershell:

    wsl --shutdown

    And to restart:

    wsl

    0 comments No comments