MailChimp 3.0 HTTP POST Json示例 [英] MailChimp 3.0 HTTP POST Json Example

查看:217
本文介绍了MailChimp 3.0 HTTP POST Json示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MailChimp的自动化触发器,该触发器在将订户的电子邮件ID发布到API端点时激活:

I'm trying to make use of MailChimp's Automation trigger that activates when a subscriber's email ID is posted to an API endpoint:

(链接)

按照工作流程说明,我使用以下 https ://us19.api.mailchimp.com/3.0/automations/xxxxxxxxxx/emails/xxxxxxxxxx/queue 通过广告系列提供的网址.

Following the Workflow instructions, I'm using the following https://us19.api.mailchimp.com/3.0/automations/xxxxxxxxxx/emails/xxxxxxxxxx/queue URL provided via the Campaign.

我可以成功发送经过身份验证的HTTP POST请求(

I can successfully send an authenticated HTTP POST request (using this do_Post() method copied into my codebase), but am faced with a 400 error with a Content-Type: application/problem+json response. My JSON is incorrect and I'm not sure what the JSON should look like to trigger the above event.

我在JSON上尝试了许多不同的破解-我最近的尝试看起来像{"unique_email_id":"e063dfcf4g"}.每次更改JSON数据的尝试仍然会在上面返回相同的错误.

I've tried a plethora of different cracks at the JSON - my latest attempt looks like {"unique_email_id":"e063dfcf4g"}. Every attempt at altering the JSON data still is returning me the same error above.

我一直在想是否可能需要在POST请求中设置更多标头,但这超出了我的专业知识范围.

I've been wondering if I possibly need to set some more headers in the POST request, but this is beyond my area of expertise.

我感谢您的帮助和见识.

I appreciate the help and insights.

推荐答案

以下是HTTP Basic Auth邮递员请求的示例:

Here's an example of HTTP Basic Auth Postman request:

POST URL:

https://us19.api.mailchimp.com/3.0/automations/********/emails/********/queue
创建基于api的触发器自动化广告系列时,您会得到此提示.

https://us19.api.mailchimp.com/3.0/automations/********/emails/********/queue
you'll get this when you create api based trigger automation campaign.

授权:

从mailchimp仪表板生成api key,并将其用作邮递员authorization中的密码.放置任何用户名.

generate the api key from mailchimp dashboard and use that as password in postman authorization. put any username.

POST正文:

{"email_address":"tigerking@gmail.com"}


了解有关mailchimp API的更多信息: https://mailchimp.com/developer/guides/get-started-with-mailchimp-api-3/

> https://npmjs.com/package/mailchimp- api-v3

这篇关于MailChimp 3.0 HTTP POST Json示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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