无法通过 Java Maleorang 的 MailChimp API 3.0 包装器获取数据 - 404 错误
Posted
技术标签:
【中文标题】无法通过 Java Maleorang 的 MailChimp API 3.0 包装器获取数据 - 404 错误【英文标题】:Can't get data by MailChimp API 3.0 wrapper for Java Maleorang - 404 error 【发布时间】:2017-02-21 01:21:26 【问题描述】:我尝试使用 Java 的 MailChimp API 3.0 包装器 - Maleorang。
我在 pom.xml 中添加了依赖
<dependency>
<groupId>com.ecwid</groupId>
<artifactId>maleorang</artifactId>
<version>$maleorang.version</version>
</dependency>
创建代码示例
@Test
public void RunMailChimp() throws Exception
MailchimpClient client = new MailchimpClient(MailChimpConstant.API_KEY);
try
EditMemberMethod.CreateOrUpdate method = new EditMemberMethod.CreateOrUpdate(list_id, email);
method.status = "subscribed";
method.merge_fields = new MailchimpObject();
method.merge_fields.mapping.put("FNAME", "***");
method.merge_fields.mapping.put("LNAME", "***");
MemberInfo member = client.execute(method);
System.err.println("The user has been successfully subscribed: " + member);
GetMembersMethod method = new GetMembersMethod(list_id);
client.execute(method);
finally
client.close();
但我收到错误 404
INFO: Request: PUT https://us14.api.mailchimp.com/3.0/lists/383444/members/8fb34d6f0c83fe617c0c45ce90b1a1096
Body: "status":"subscribed","merge_fields":"FNAME":"***","LNAME":"***","email_address":"****@mail.ru"
окт 12, 2016 12:03:40 PM com.ecwid.maleorang.MailchimpClient execute
INFO: Response: 404 Not Found
Body: "type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Resource Not Found","status":404,"detail":"The requested resource could not be found.","instance":""
com.ecwid.maleorang.MailchimpException: API Error (404): The requested resource could not be found.
链接 https://us14.api.mailchimp.com/3.0/lists/383444/members/8fb34d6f0c83fe617c0c45ce90b1a1096 , h_t_t_p_s://_us14.api.mailchimp.com/3.0/lists/38341/members 生成方法也不会在浏览器中打开(404 错误)
谢谢!
【问题讨论】:
【参考方案1】:需要使用列表中的列表 ID->设置->列表的唯一 ID。而不是来自 url 的列表 ID。
【讨论】:
你也可以看看这个类似的问题吗? ***.com/questions/42952518/…以上是关于无法通过 Java Maleorang 的 MailChimp API 3.0 包装器获取数据 - 404 错误的主要内容,如果未能解决你的问题,请参考以下文章
java.lang.RuntimeException:无法启动活动 ComponentInfoat.mksquad.swapit/at.mksquad.swapit.ui.screenflow.mai