SendGrid — How to delete a single Marketing Campaign recipient with API and PHP

跟風遠走 提交于 2019-12-11 04:56:19

问题


Will someone help me with the PHP code to authenticate my Sendgrid account connection and then delete a Marketing Campaign recipient via API?

From the help documentation, this appears to be the command line -- DELETE https://api.sendgrid.com/v3/contactdb/lists/{list_id}/recipients/{recipient_id} HTTP/1.1 -- but I can't figure out what to do with it, since it isn't regular PHP code. The only sample code I found pertained to Legacy Newletters (which I got to work) and not contacts used by Marketing Campaigns.


回答1:


What are you using to interact with the API? cURL? You just need to make an HTTP DELETE request to the url https://api.sendgrid.com/v3/contactdb/lists/{list_id}/recipients/{recipient_id}, replacing {list_id} and {recipient_id} with the IDs of the list and the recipient.

Here's an example of a function that will make a delete request for you with cURL: https://stackoverflow.com/a/17935536/401096



来源:https://stackoverflow.com/questions/41816612/sendgrid-how-to-delete-a-single-marketing-campaign-recipient-with-api-and-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!