I have tried to call authentication API by using escrow REST full API. However I am not getting any valid response from the authentication API.
I have used Codeigniter CURL method to post the variables with the URL https://stgsecureapi.escrow.com/api/Transaction however it still not working for me.
i am getting the following response : Authentication denied
Please help me if any one have the idea to resolve out this.
Code I am using :
//The JSON data.
$url = 'https://stgsecureapi.escrow.com/api/Transaction';
$jsonData = array(
'username' => '*****@gmail.com',
'password' => '****',
'pid' => '***'
);
//Encode the array into JSON.
$jsonDataEncoded = json_encode($jsonData);
print_r($jsonDataEncoded);
// Start session (also wipes existing/previous sessions)
$this->curl->create($url);
// Option
$this->curl->option(CURLOPT_HTTPHEADER, array('Content-type: application/json; Charset=UTF-8'));
// Post - If you do not use post, it will just run a GET request
$this->curl->post($jsonDataEncoded);
// Execute - returns responce
$this->data['curlreturn'] = $this->curl->execute();
//exit;
$this->load->view('pay/pay', $this->data);
I got the answer by Escrow with the population of XML..
Also check the function, that am used to call the API with CURL
Success message with authentication id (Session Id):
HTTP/1.1 100 Continue HTTP/1.1 201 Created Cache-Control: no-cache Pragma: no-cache Content-Length: 271 Content-Type: application/xml; charset=utf-8 Expires: -1 Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Sat, 16 May 2015 13:14:09 GMT Connection: close Successful 646494
This session ID 646494 is used to get the transactions details from escrow.