SendGrid — How to delete a single Marketing Campai

2019-08-02 16:21发布

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条回答
ゆ 、 Hurt°
2楼-- · 2019-08-02 16:46

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

查看更多
登录 后发表回答