我正在尝试做一个简单的JSON调用,以将标签添加到新订户或现有订户。
它添加订户的名字,姓氏和电子邮件地址,但不添加标签。我不确定自己在做什么错。
这就是我所拥有的:
public function apiUrl() {
$apiKey = $this->Key;
$listId = $this->ListID;
$memberId = $memberId = md5(strtolower($this->Email));
$getapi = substr($this->escape($apiKey),strpos($this->escape($apiKey),'-') + 1);
return 'https://' . $this->escape($getapi) . '.api.mailchimp.com/3.0/lists/' . $this->escape($listId) . '/members/' . $this->escape($memberId);
}
public function jsonData() {
return json_encode(array(
'email_address' => $this->escape($this->Email),'status' => $this->escape($this->Status),'tags' => ['name' => 'Calendar Users','status' => 'active'],'merge_fields' => array(
'FNAME' => $this->escape($this->FName),'LNAME' => $this->escape($this->LName)
)
));
}