【发布时间】:2016-12-17 18:48:41
【问题描述】:
这是我使用那里的 API 从翻转卡丁车中检索数据的 curl php 程序。但是无论我做什么,我都会遇到与以下相同的错误:
{"error":"unauthorized","error_description":"An Authentication object was not found in the SecurityContext"}
<?php
$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);
?>
我不知道是什么错误,如果问题出在我给出的 appid 和 appsecret 上,我检查了多少次,但仍然显示相同的错误。
【问题讨论】:
-
谁能帮我解决这个问题
标签: php json api phpmyadmin flipkart-api