错误400:通过ColdFusion从instagram API获取json数据时请求错误

狮子狮子

害怕问这个问题,因为我无法为其创建jsfiddle,但希望有人能够提供帮助。

我正在尝试在ColdFusion中为instagram登录创建cfc。这部分完成了。我使用的是邮递员(Google应用程序),凭我的凭据,我可以在json中看到用户的数据,但是当我将其转换为ColdFusion时,会出现错误。我试图更改数据类型,标头和很多行,但仍然一次又一次遇到相同的错误。

我的代码(为安全起见,用xxx替换了id)

<cftry>
<cfhttp url="https://api.instagram.com/oauth/access_token" method="post" resolveurl="yes">
    <cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
    <cfhttpparam type="formfield" name="client_id" value="14faxxxxxdc5440f86x6cdd8xxxxf78" />
    <cfhttpparam type="formField" name="client_secret" value="40xa78220cfb" />
    <cfhttpparam type="formField" name="grant_type" value="authorization_code" />
    <cfhttpparam type="formField" name="redirect_uri" value="#URLEncodedFormat('http://example.com/demo/instagramAPI/success.cfm')#" />
    <cfhttpparam type="formField" name="code" value="#url.code#" />
</cfhttp>
<cfdump var="#cfhttp#"><cfabort>
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>  

我正在从此答案中遵循此代码有关更多信息,请检查此图片您可以看到我使用相同的登录详细信息来获取数据,但是通过cfc进行相同操作时却出现错误。

运行网址后出现的错误: 错误

我已经阅读了许多文章和博客,但仍然无法解决该错误。谁能帮助我了解我在做什么错?如果您还有其他建议,请告诉我。

如果需要任何其他信息,请告诉我。

狮子狮子

几天之后,终于我得到了我问题的答案。.Thanx Miguel-F和Mark A Kruger但是Mark的链接对我不利,因为那是我的问题。

What i did is to update my SSL certificate. I tried before but was not having much information like Organization unit etc but then i followed the steps given in this Link, provided by Miguel and tested then i got expiration code error.

After that i tried to refresh with ?reinit=1 as i made changes in my cfc but forget to reinitialize after updating the certificate, and then i got the result :)

SO final answer is Update your SSL certificate with proper authorization and cfc can fetch data from Instagram..

Link useful for me One, CFC demo. In cfc demo you can download the cfc for instagram which is also useful (even in case you don't have to update the SSL certificate).

如果有人对Instagram cfc有疑问,请告诉我。.我花了几天时间在此上,可以为您提供帮助.. :)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用okHttp 4.将json数据发布到rest api时,响应代码为400的错误请求

尝试从公共API获取JSON数据时出现错误

尝试发布大型JSON数据时出现错误的请求错误

获取角色-Azure API返回(400)错误的请求

通过菜单获取下拉菜单上Flask上的数据给出了400错误请求

登录时通过Apache反向代理400的OctoPrint错误请求

在访问API时在Python中获取请求错误404

在Linkedin API中获取AudienceCountsV2时遇到400错误的请求

Kendo MVC Core-网格-无法通过路由获取数据-400错误的请求

如何在获取“ httpStatus 400-错误请求”时解决POST API调用?

ReactJS- Youtube数据API请求错误400

Instagram OAuth API返回“ insufficient_dev_role” 400错误

获取开放天气API(地理位置)时出现错误400错误的请求

当我尝试通过访存与Api连接时,为什么会收到“错误请求”错误400?

Instagram无效响应错误-400

Instagram GET / locations / search返回400错误

通过HttpURLConnection张贴JSON数据时出现HTTP错误400错误请求

JavaScript数据存储区API请求中的Dropbox 400错误

当请求访问令牌时,Retrofit + Instagram API返回错误400

json api获取请求错误

使用类型为“Content-Type:application/octet-stream”的数据调用 Microsoft Azure Emotion API 时获取“状态代码:400 错误请求”

Nodejs instagram api post请求authcode,它给出了错误400

JSON 输入意外结束,通过请求获取 Instagram JSON 数据

通过 Ajax 对 Post .Net Core API 的 400 错误请求

尝试从 API 获取 JSON 数据时出现 No such file or directory 错误?

通过python请求上传图像时出现错误400(错误请求)

从 Microsoft Graph Api 为 SchemaExtensions 获取 400 个错误请求

尝试链接 API 时收到“400 错误请求”

无法获取错误 400 错误请求的数据