【问题标题】:Post update to Buffer API error - "Please select at least one account to post from"将更新发布到 Buffer API 错误 - “请至少选择一个帐户来发布”
【发布时间】:2016-05-08 11:09:40
【问题描述】:

我正在扩展一个应用程序,以使用 Buffer API 将半自动发布到社交媒体。我无法将更新发布到 Buffer。

使用Postman 使用API​​,一切都已成功验证,我可以GET 任何我需要的东西,但是,当我尝试POST 更新时,我不断收到错误"Please select at least one account to post from" 返回.

将所需参数添加到邮递员后,我有以下请求网址,但失败:

https://api.bufferapp.com/1/updates/create.json?pretty=true&access_token=1/XXXXXXXXXXXXX&profile_ids[]=XXXXXXXXXXXX&text=This is an update

在阅读this twitter线程后,我也尝试了以下方法,但没有运气:

https://api.bufferapp.com/1/updates/create.json?pretty=true&access_token=1/XXXXXXXXXXXXX&profile_ids%5B%5D=XXXXXXXXXXXX&text=This is an update

完整的错误/响应是:

{
    "success": false,
    "message": "Please select at least one account to post from.",
    "code": 1004
}

相关文档为here

我忽略了什么?我偷偷地怀疑这是我没有看到的简单的东西。

非常感谢任何帮助:)

【问题讨论】:

    标签: post postman


    【解决方案1】:

    您是否尝试过将 POST 数据放在请求的正文中,而不是 URL 中?例如:

    HTTP/POST https://api.bufferapp.com/1/updates/create.json
    Content-Type: application/x-www-form-urlencoded
    
    pretty=true&access_token=1/XXXXXXXXXXXXX&profile_ids[]=XXXXXXXXXXXX&text=This is an update
    

    【讨论】:

    • 感谢标题..这是我的问题
    • 只是为了扩展这一点,Buffer API 需要 x-www-form-urlencoded。如果您使用的是节点,您可以使用普通的 JS 对象作为请求正文,然后使用 querystring 模块 (qs.encode(myPlainObject)) 对其进行编码以作为正文发送。
    • 能否请您建议我如何将scheduled_at 与这个... "scheduled_at =\"2018-04-05T17:40:01.-14400Z\"&access_token=1/xxxxxxxxxxxx&profile_ids[]=yyyyyy&text=这是一个更新16:"
    • @Raji 如果没有周围的引号,它可以工作吗? scheduled_at=2018-04-05T17:40:01.0Z&.... 或不带反斜杠:scheduled_at="2018-04-05T17:40:01.0Z"&....
    • @ChrisBlunt 如果我想以Content-Type: application/json 的身份发布怎么办
    猜你喜欢
    • 1970-01-01
    • 2022-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多