SendGrid-如何使用API​​和PHP删除单个Marketing Campaign收件人 [英] SendGrid -- How to delete a single Marketing Campaign recipient with API and PHP

查看:101
本文介绍了SendGrid-如何使用API​​和PHP删除单个Marketing Campaign收件人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人会帮助我使用PHP代码来验证我的Sendgrid帐户连接,然后通过API删除Marketing Campaign收件人吗?

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

在帮助文档中,这似乎是命令行-DELETE https://api.sendgrid.com/v3/contactdb/lists/ {list_id}/recipients/{recipient_id} HTTP/1.1-但我不知道该怎么做,因为它不正常PHP代码.我发现的唯一示例代码与旧版时事通讯有关(我必须开始工作),而与Marketing Campaigns使用的联系人无关.

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.

推荐答案

您使用什么与API进行交互?卷曲?您只需要向URL https://api.sendgrid.com/v3/contactdb/lists/{list_id}/recipients/{recipient_id}发出HTTP DELETE请求,用列表和收件人的ID替换{list_id}{recipient_id}.

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.

以下是一个函数示例,该函数将使用cURL向您发出删除请求: https://stackoverflow.com/a/17935536/401096

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

这篇关于SendGrid-如何使用API​​和PHP删除单个Marketing Campaign收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆