我正在尝试访问 Flipkart 卖家 API,因为我在 Flipkart 卖家 API 中注册 - 开发人员管理门户,请按照文档中给出的步骤进行操作:-
https://seller.flipkart.com/api-docs/FMSAPI.html
在我点击第一个用于生成访问令牌的 API 时成功注册到 Flipkart 后,但是当我通过我的代码点击此 API 时,它将返回登录页面 html 作为响应。我还尝试通过以下步骤通过邮递员来解决这个问题:-
1)Type of request i tried with both (GET,POST)
2)Set appid and app-secret in the header
3)Use the following url:-
https://api.flipkart.net/oauth-service/oauth/token\?grant_type\=client_credentials\&scope=Seller_Api
我得到以下回复:-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Flipkart</title>
<link type="text/css" rel="stylesheet"
href="./style.css" />
<link type="text/css" rel="stylesheet"
href="./bootstrap.css" />
</head>
<body>
<div class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Flipkart Permission Registration</a>
</div>
</div>
</div>
<div class="container">
<form id="loginForm" name="loginForm" role="form" class="form-signin" action="login.do" method="post">
<h2 class="form-signin-heading">Please sign in </h2>
<input type="email" class="form-control" placeholder="Email address"
name='j_username' required="" autofocus="">
<input type="password" name='j_password' class="form-control"
placeholder="Password" required="">
<button class="btn btn-lg btn-primary btn-block" type="submit" name="login">Sign in</button>
<input type="hidden" name="CSRFToken" value="987f582b-9a4e-4c6c-a14b-681f2b57ca34"></input>
</form>
</div>
</body>
</html>
我还尝试了他们提供的沙盒 URL,但在这两种情况下的响应相同。
当我用谷歌搜索这个问题时,我发现某个地方需要更改 URL,例如:-
https://api.flipkart.net/oauth-service/oauth/token?grant_type=client_credentials&scope=Seller_Api
我也试过这个,但这将返回响应: -
{
"error": "unauthorized",
"error_description": "An Authentication object was not found in the SecurityContext"
}
所以最后我无法获得 Flipkart 卖家 API 的访问令牌。请帮助我任何帮助将不胜感激谢谢!