Azure / Azure/azure-sdk-for-python

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

Offen
#42,010 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Client Communication - SMS customer-reported needs-team-attention question Service Attention
Vorherrschende Sprache
Python
Sterne
5.6k
Forks
3.4k
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
202

Beschreibung

**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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py bei SMSClient.send, wo das Problem den Fehler bei der Empfängerbegrenzung meldet. Verfolge, wie Empfänger übermittelt werden, und prüfe anschließend, dass Listen mit mehr als 100 Einträgen in Gruppen von 100 aufgeteilt und über wiederholte API-Anfragen gesendet werden, ohne das angeforderte Verhalten für kleinere Listen zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, python
Bereich
api
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.