Closed hamidarrivy closed 5 years ago
Having the same issue here. Was it resolve? Thank you.
figured it out. Need to add Content-Type: application/json header that not mentioned on the API documentation page https://sendgrid.api-docs.io/v3.0/bounces-api/delete-bounces or https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-requests
I am working on a GAE(Google App Engine) based python app and which have sendgrid python SDK(v3.2.10) integrated into it. What I am trying do is right now that whenever sendgrid pushes an event webhook of type "bounce" I want to delete that bounced email from the list of bounced emails present on sendgrid.
I have already gone through the documentation provided on the official site. First I tried to delete email address using SDK and it worked fine on localhost. But after deploying it to the live server it just doesn't do anything and falls in the exception clause. Please see the code snippet below:
As, it did not work as expected, Now I am trying to do the same using REST API. Please see the code snippet below:
Now, sendgrid API is continuously returning error 400 with message
{"errors":[{"field":null,"message":"emails or delete_all params required"}]}
. I simply could not figure out how to overcome this issue. Maybe I am missing how to pass request body in thedelete
function but, I could not figure it out.Any urgent help would be highly appreciated. Thanks.