我尝试使用此代码获取mailjet统计信息:
require 'vendor/autoload.php';
use \Mailjet\Resources;
$mj = new \Mailjet\Client('xxxxxxxxxxxxxxxxxxxx','xxxxxxxxxxxxxxxx');
$body = [
'EventType' => "unsub",
'Url' => "http://example.com/Eventcallbackurl"];
$response = $mj->post(Resources::$Eventcallbackurl, ['body' => $body]);
$response->success();
var_dump($response->getData()));
以便代码返回以下错误:
MJ18一个EventCallbackURL资源,其值为" 5 | false" for EventType |备份已存在。
答案 0 :(得分:1)
好吧,我也可能不理解你的问题,但这可能会有所帮助:
$filters = array('CustomID' => 'the custom id when creating a capmaign');
$response = $mj->get(Resources::$Messagesentstatistics, array('filters' => $filters))
答案 1 :(得分:0)
与已回答的API一样,您已经注册了该资源。如果您要修改网址,可能需要PUT
使用ID
unsub|false
和有效负载[ "Url" => $newURL ]