获取访问令牌的box api错误:无效的grant_type参数或参数丢失 [英] box api error getting the access token: Invalid grant_type parameter or parameter missing

查看:2835
本文介绍了获取访问令牌的box api错误:无效的grant_type参数或参数丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取访问令牌并使用以下网址发布HTTP请求并接收

I am trying to get an access token and using the following url to POST the HTTP request and receiving

{
  "error":"invalid_request",
  "error_description":"Invalid grant_type parameter or parameter missing"
} 

错误消息。无论我尝试什么。我收到代码后发帖秒,所以我不认为代码可能是失败点。

error message . No matter what I try. I am posting seconds after receiving the code so I dont think the code could be the failure point.

发布 https://api.box.com/oauth2/token?grant_type=authorization_code&code=H23sCQmlzsEJSEyhKXj19yb1LWew9MPk&client_id = xyz& client_secret = 123

我做错了什么?

推荐答案

我想您可能会尝试在请求正文中发送 grant_type = ... ,而不是查询字符串。

I think you might try sending the grant_type=... in the request body, not as a query string.

以下是该特定请求的文档示例:

Here's the documentation example for that particular request:

curl https://api.box.com/oauth2/令牌\

-d'grant_type = authorization_code& code = {your_code}& client_id = {your_client_id}& client_secret = {your_client_secret} '\

-X POST

这篇关于获取访问令牌的box api错误:无效的grant_type参数或参数丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆