使用刷新令牌 PHP 的 eBay OAuth 令牌
请帮助我使用刷新令牌 API 修复 eBay OAuth 令牌中的无效范围问题。我处于生产模式。即使主要范围 https://api.ebay.com/oauth/api_scope 也无法正常工作为我。我正在使用 PHP。
$curlSecondHandler = curl_init();
curl_setopt_array($curlSecondHandler, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => "grant_type=refresh_token&refresh_token=".$refreshToken."&scope=".urlencode($scopes),
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode($clientId . ':' . $certId)
],
]);
Please help me to fix the invalid scope issue in eBay OAuth Token Using Refresh Token API. I am in production Mode. Even not the primary scope https://api.ebay.com/oauth/api_scope is working for me. I am using PHP.
$curlSecondHandler = curl_init();
curl_setopt_array($curlSecondHandler, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => "grant_type=refresh_token&refresh_token=".$refreshToken."&scope=".urlencode($scopes),
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode($clientId . ':' . $certId)
],
]);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保范围与同意请求期间使用的范围相同。您还可以删除scopes参数以获取原始同意请求中的所有范围。如果您希望添加更多范围,则需要再次获得附加范围的同意并获得新的刷新令牌。
https://developer.ebay.com/api-文档/static/oauth-refresh-token-request.html
Make sure that the scopes are the same as the ones used during the consent request. You can also remove the scopes parameter to get all the scopes from the original consent request. If you wish to add more scopes, you would need to go through consent once again with the additional scopes and gain a new refresh_token.
https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html