sendinblue / APIv3-python-library

SendinBlue's python library for API v3
MIT License
82 stars 40 forks source link

unexpected recipients: want atleast 1, got 0 #71

Closed Ashish2000L closed 2 years ago

Ashish2000L commented 3 years ago

OS: Windows 10 python: 3.8.6 sib-api-v3-sdk: 7.2.0 error sib_api_v3_sdk.rest.ApiException: (400) Reason: Bad Request HTTP response headers: HTTPHeaderDict({'Date': 'Wed, 18 Aug 2021 18:07:27 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '85', 'Connection': 'keep-alive', 'vary': 'Origin, Accept-Encoding', 'access-control-allow-credentials': 'true,true', 'x-frame-options': 'SAMEORIGIN', 'strict-transport-security': 'max-age=0; includeSubDomains', 'x-download-options': 'noopen', 'etag': 'W/"55-W7t5+KpJf/icK+MswT/OhBIO1ow"', 'x-envoy-upstream-service-time': '9', 'sib-request-id': 'c09183fd-7535-9b33-b98e-b52fc79b75a1', 'access-control-allow-origin': '*', 'access-control-allow-headers': '*', 'access-control-allow-methods': 'PUT, POST, GET, DELETE, PATCH, OPTIONS', 'X-Sib-Server': 'SENDINBLUE-srv-pr-rancher-worker-online-25', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1', 'CF-Cache-Status': 'DYNAMIC', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'CF-RAY': '680d14f0280433d8-DEL'}) HTTP response body: {"code":"INVALID_PARAMETER","message":"unexpected recipients: want atleast 1, got 0"}

code `api_instance = sib_api_v3_sdk.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(config))

send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(sender={'email':'somename@somename.com','name':'somename'},to=[{'email':email,'name':name}], subject="some subject",html_content=body)

api_response = api_instance.send_transac_email(send_smtp_email)`

I think I had set all things in here but still having errors only at a particular email, other emails are working fine with the same code. Help me if I am missing something. Googled on it but didn't find anything that can help me out.

mukul-brevo commented 2 years ago

This has been fixed already