Flipkart Api:尝试从api检索数据时出错

This is the curl, php program i gave to retrieve data from flip kart using there API. But what ever i do , i am getting the same error as :

{"error":"unauthorized","error_description":"An Authentication object was not found in the SecurityContext"}


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.flipkart.net/oauth-service/oauth/token?grant_type=client_credentials&scope=Seller_Api,Default");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$vars);  //Post Fields
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$headers = array();
$headers[] = 'appid:appsecret';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$server_output = curl_exec ($ch);

print  $server_output ;

curl_close ($ch);


I dont know what is the error , i checked number of time if the problem is with appid and appsecret i gave but still its showing same error.

Flipkart Documentation Link

2016/08/11 07:02
  • json
  • php
  • api
  • 点赞
  • 收藏
  • 回答