Error in getting Active subscriber count from Sendy API

359 Views Asked by At

While trying to fetch the active subscriber count from Sendy API, I am getting following error enter image description here

The POST request looks like this:

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

In header: Content-Type:application/x-www-form-urlencoded

In Body:

api_key= mykey
list_id= mylistid

Can anyone please help?

1

There are 1 best solutions below

1
Mian Dawood shah On
$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);