Azure / Azure/azure-sdk-for-python
Automatically chunk SMS recipients to avoid"Max of 100 phone numbers are allowed in the To field."
- Lenguaje dominante
- Python
- Estrellas
- 5.6k
- Forks
- 3.4k
- Merge medio
- 2 d 2 h
- PR fusionados (30 d)
- 213
Descripción
**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.
Guía de contribución
Línea de trabajo
Comienza en sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py, en SMSClient.send, donde el problema informa del fallo relacionado con el límite de destinatarios. Traza cómo se envían los destinatarios y, a continuación, verifica que las listas de más de 100 se dividan en grupos de 100 y se envíen mediante solicitudes API repetidas, sin cambiar el comportamiento solicitado para las listas más pequeñas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- azure, python
- Área
- api
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100