Azure / Azure/azure-sdk-for-python
Automatically chunk SMS recipients to avoid"Max of 100 phone numbers are allowed in the To field."
- 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
Assessment
This issue has not been assessed yet.