php – MailChimp API会员信息问题

前端之家收集整理的这篇文章主要介绍了php – MailChimp API会员信息问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要通过api检索所有用户信息,在我发现的文档中查找它:
http://apidocs.mailchimp.com/api/2.0/lists/member-info.php

这是我的代码

  1. $params = array(
  2. 'id' => $list_id,'emails' => array(
  3. 'euid' => $member_id,),);
  4. $infos = $this->MailChimp->call('lists/member-info',$params);
  5.  
  6. print_r($infos);@H_502_5@
  7. 这就是结果:

  8. Array ( [success_count] => 0 [error_count] => 1 [errors] => Array ( [0] => Array ( [email] => 63a885b7cf [error] => "email" should be a struct [code] => -100 ) ) [data] => Array ( ) )@H_502_5@ 
  9.  

    “”电子邮件“应该是一个结构”是什么意思?

这也有效,并且稍微简单一些:
  1. $result = $MailChimp->call('lists/member-info',array(
  2. 'id' => $list_id,'emails' => array(array('email'=>$email))
  3. ));@H_502_5@
  4. 以上示例使用此APIhttps://github.com/drewm/mailchimp-api/

猜你在找的PHP相关文章