1

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?

David Buck
  • 3,752
  • 35
  • 31
  • 35
Yog
  • 21
  • 3
  • This question shows no own research effort at all. Did you at least have a look at https://sendy.co/get-started ? – digijay Dec 26 '18 at 11:44
  • Yes @digijay, I did all the research at my end. I have the latest version of sendy i.e 3.1.1. I have a total 10 brands in my sendy and several lists are there. Now I want to fetch the subscribers count for each list using api. I have also gone through the api documentation as well as explored the sendy's support forum for the same. – Yog Dec 28 '18 at 09:56

1 Answers1

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);