删除mailchimp广告活动-找不到资源

时间:2019-06-02 19:49:37

标签: php curl mailchimp

我正在尝试删除mailchimp广告系列,但出现错误。我在做什么错了?

这是我的curl命令:

public function executeCurlDelete($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERPWD, 'apikey:'.$this->apikey);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);//returns output as variable

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
    $result = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    $output = CJSON::decode(curl_exec($ch));
    curl_close($ch);
    if ($output !== true){
        throw new CException($output['title']);
    }

    return $output === true;
}

public function deleteCampaign($campaignId){
    ///campaigns/{campaign_id}
    $url = "$this->apiEndpoint/campaigns/$campaignId";
    return $this->executeCurlDelete($url);
}

这是错误:

找不到请求的资源。

0 个答案:

没有答案