从Sendy API获取活动订户计数时出错

问题描述 投票:1回答:1

[尝试从Sendy API提取活动订户数时,出现以下错误“在此处输入图像描述”

POST请求看起来像这样:

http://my-sandy-Installation/api/subscribers/active-subscriber-count.php

在标题中:Content-Type:application/x-www-form-urlencoded

在正文中:

api_key= mykey
list_id= mylistid

谁能帮忙吗?

php post sendy
1个回答
0
投票
$boolean = 'true';
$postdata = http_build_query(
    array(
    'email' => $email,
    'api_key'=>'your api_key',
    'list' => 'Your List id',
    'boolean' => 'true'
    )
);

$opts = array('http' => array('method'  => 'POST', 'header'  => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata));
$context  = stream_context_create($opts);
$result = file_get_contents($your_installation_url.'/subscribe', false, $context);
© www.soinside.com 2019 - 2024. All rights reserved.