向 PHP 的 Mailchimp API 请求添加查询参数
Adding Query Parameters to Mailchimp API request for PHP
我目前正在关注此处看到的文档:https://mailchimp.com/developer/marketing/api/list-members/list-members-info/
使用 PHP 示例:
$response = $client->lists->getList("list_id");
这个returns就好了。但我想添加 'unsubscribed_since' 查询参数。
如何格式化查询参数?
我试过:
$response = $mailchimp->lists->getListMembersInfo("id", array('unsubscribed_since' => '2020-01-01'));
以及:
$response = $mailchimp->lists->getListMembersInfo("3d65de82df", ['unsubscribed_since' => '2020-01-01']);
如有任何帮助,我们将不胜感激。
我对 count 参数有类似的问题。查看代码,我发现了 getListMembersInfo 方法的以下定义:
public function getListMembersInfo($list_id, $fields = null, $exclude_fields = null, $count = '10', $offset = '0', $email_type = null, $status = null, $since_timestamp_opt = null, $before_timestamp_opt = null, $since_last_changed = null, $before_last_changed = null, $unique_email_id = null, $vip_only = null, $interest_category_id = null, $interest_ids = null, $interest_match = null, $sort_field = null, $sort_dir = null, $since_last_campaign = null, $unsubscribed_since = null)
使用附加参数调用方法解决了我的问题。
我目前正在关注此处看到的文档:https://mailchimp.com/developer/marketing/api/list-members/list-members-info/ 使用 PHP 示例:
$response = $client->lists->getList("list_id");
这个returns就好了。但我想添加 'unsubscribed_since' 查询参数。 如何格式化查询参数? 我试过:
$response = $mailchimp->lists->getListMembersInfo("id", array('unsubscribed_since' => '2020-01-01'));
以及:
$response = $mailchimp->lists->getListMembersInfo("3d65de82df", ['unsubscribed_since' => '2020-01-01']);
如有任何帮助,我们将不胜感激。
我对 count 参数有类似的问题。查看代码,我发现了 getListMembersInfo 方法的以下定义:
public function getListMembersInfo($list_id, $fields = null, $exclude_fields = null, $count = '10', $offset = '0', $email_type = null, $status = null, $since_timestamp_opt = null, $before_timestamp_opt = null, $since_last_changed = null, $before_last_changed = null, $unique_email_id = null, $vip_only = null, $interest_category_id = null, $interest_ids = null, $interest_match = null, $sort_field = null, $sort_dir = null, $since_last_campaign = null, $unsubscribed_since = null)
使用附加参数调用方法解决了我的问题。