AnsweredAssumed Answered

API Version 2 login complication

Question asked by jthakar on Oct 28, 2011
Latest reply on Feb 10, 2012 by Q Nimbus

Hi

 

I have just moved to API ver 2 for some functionality and i am stucked at first step only, thats Session/login

 

below is the php curl code i am using to login

 

 

$dataStr = "echo_request=1&action=login&username=".$this->qualysUserName."&password=".$this->qualysPassword;
$this->cUrl = 'https://qualysapi.qualys.com/api/2.0/fo/session/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->cUrl);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataStr);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  // this line makes it work under https
$response = curl_exec($ch);

 

and every time the response is as given below..

its redirecting to some help located on " https://qualysapi.qualys.com/qwebhelp/fo_help/index.htm"

 

HTTP/1.1 302 Found Date: Fri, 28 Oct 2011 09:02:39 GMT Server: qweb Location: https://qualysapi.qualys.com/qwebhelp/fo_help/index.htm Transfer-Encoding: chunked Content-Type: text/html

 

can anyone please tell me if i am going wrong some where?

 

or my account needs any special previles to use API ver 2, as i am using ver 1 api and its working fine with same way

Outcomes