0

I have created several static Segments in Mailchimp for a List. I am writing some PHP to create campaigns, but I am stuck on a hurdle early on.

I am using v1.3 of the MailChimp API

$api = new MCAPI( $this->config['api_key'] );
$lists = $api->listStaticSegments( $list_id );

var_dump( $api );
var_dump( $lists ); 

Results:

object(MCAPI)[39]
public 'version' => string '1.3' (length=3)
public 'errorMessage' => string '' (length=0)
public 'errorCode' => string '' (length=0)
public 'apiUrl' => 
  array (size=4)
    'scheme' => string 'http' (length=4)
    'host' => string 'api.mailchimp.com' (length=17)
    'path' => string '/1.3/' (length=5)
      'query' => string 'output=php' (length=10)
  public 'timeout' => int 300
  public 'chunkSize' => int 8192
  public 'api_key' => string 'XXX' (length=XX)
  public 'secure' => boolean false

  array (size=0)
  empty

I am expecting $lists to have 10 items in an array. When I log into MailChimp and check the API Account API Keys page, I can see there are requests but there are no responses.

enter image description here

4

1 回答 1

0

啊哈。问题是我没有静态列表。我创建的列表是动态段(自动更新),因此我必须使用campaignSegmentTest为动态段生成相同的标准。

http://apidocs.mailchimp.com/api/1.3/campaignsegmenttest.func.php

对 Google Mailchimp 论坛的进一步研究:

https://groups.google.com/forum/#!msg/mailchimp-api-discuss/63DLfYq7ydI/jyGASmUxK8AJ

于 2013-09-22T08:15:17.577 回答