Azure / Azure/azure-sdk-for-python

Automatically chunk SMS recipients to avoid"Max of 100 phone numbers are allowed in the To field."

Open
#42,010 1 comment 0 reactions 0 assignees View on GitHub
Client Communication - SMS customer-reported needs-team-attention question Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

**Is your feature request related to a problem? Please describe.**

[`SMSClient.send`](https://github.com/Azure/azure-sdk-for-python/blob/9d7aea0a14d0766398b3c18ac8ddad2df95f0750/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py#L84) can fail with:

```
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Bad Request'
Content: {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.1","title":"One or more validation errors occurred.","status":400,"errors":{"SmsRecipients":["Max of 100 phone numbers are allowed in the To field."]},"traceId":"..."}
````

**Describe the solution you'd like**

Automatically chunk the list in to groups of 100 and make repeated API requests.

**Describe alternatives you've considered**

Manually chunk at the caller, but that requires the user to know about the API limitation ahead of time.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.