通过Mailchimp API v3.0中的列表方法检索电子邮件地址(仅)

时间:2016-11-05 15:11:25

标签: php mailchimp mailchimp-api-v3.0

我从Mailchimp API 2.0 - 3.0开始迁移,实际上是在尝试复制我之前使用过的方法。

一项任务是检索特定列表中的所有成员电子邮件地址

目前我有

you have not called jquery properlly, please add jquery as mentioned in below code.

<html>
<head>
  <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
  <script src="http://googleads.g.doubleclick.net/pcs/click?xai=AKAOjsskoPaKjpYu8DK0oiP7OYYa9-A9I7CpjKFG67eM5bDqwk7ZV2TT-34qu4fCp92Y2TEIfbX8dj-6vPUezLZ60FPo9y2zGtNrl64NtBc_79RxtrJhBn26YWvvq1XiSZtWXfY-ML7nBmtrCTm02RWO8eiXGK-gctEOfZvzaFRQISYn4GlDgpkqNyEMUm6X6-eKP7xTMr4vzjmPShzKYVE_xNd-siI_3Pk_-2U6c3x5HZpHZGOg6Fo&sig=Cg0ArKJSzAR_3zib5yc4&adurl=http://www.w3schools.com/w3css/w3css_templates.asp&nm=2&nx=179&ny=48&mb=1" ></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
 var w = window.innerWidth;
 var w = window.innerWidth;
 function resize(){
 if (w > 1366){
   $(".object").addClass("w3-quarter").removeClass("w3-half w3-third");
 } else if (w <= 1366 && w > 800){
   $(".object").addClass("w3-third").removeClass("w3-half w3-qurter");
 } else { $(".object").addClass("w3-half").removeClass("w3-third w3-qurter");
 }
 }
 $(document).ready(function(){
 resize();
 $(window).resize(resize);
 });

</script>
</head>
<body>

 <h1>Heading 1</h1>
 <h2>Heading 2</h2>

 <div class="object w3-qurter">
    <p>This is a paragraph.</p>
    <p>This is another paragraph.</p>
 </div>
 <div class="object w3-qurter">
    <p>This is a paragraph.</p>
    <p>This is another paragraph.</p>
  </div>
 <div class="object w3-qurter">
   <p>This is a paragraph.</p>
   <p>This is another paragraph.</p>
 </div>
 <div class="object w3-qurter">
   <p>This is a paragraph.</p>
   <p>This is another paragraph.</p>
 </div>


 </body>
 </html>

返回一个成员数组,但我无法弄清楚如何将fields参数添加到url中,所以我只检索我想要的字段,(例如fname,email address)

1 个答案:

答案 0 :(得分:2)

解决了它,它在第一页

http://developer.mailchimp.com/documentation/mailchimp/guides/get-started-with-mailchimp-api-3/

例如,只获取id,电子邮件地址和合并字段,......

$result = $MailChimp->get('/lists/'.$list_id.'/members?fields=members.id,members.email_address,members.merge_fields');