Good day,
I'm trying to use this API in a part of a system. Right now I'm only
using the SearchContacts method, the problem is that when I make the
HTTP request to the service it gives a 403 error: Forbidden.
This is the code I'm using to access the service:
$context_options=array();
$data = array("format" => "xml",
"fields" => "all",
"appid" => APPID,
"WSSID" => $this->wssid);
if(is_null($headers))
{
$context_options = array (
'http' => array (
'method' => 'GET' )
);
}else{
$context_options = array (
'http' => array (
'method' => 'GET',
'header'=> "$headers",
)
);
}
$context = stream_context_create($context_options);
if(is_null($data))
{
$fp = fopen($url, 'r', false, $context);
}
else
{
$data = http_build_query($data);
$fp = fopen($url."?".$data, 'r', false, $context);
}
$test="";
while (!feof($fp)) {
$test .= fread($fp, 8192);
}
return $test;
I hope you could throw some light to my problem. Thanks.