Pinterest API giving Error code 3

一世执手 提交于 2019-12-02 05:48:43

问题


I am hitting Pinterest's /v1/me/boards API, but i am getting following response:

{"status": "failure", "code": 3, "host": "devplatform-devapi-prod-d4f1472d", "generated_at": "Tue, 05 Jan 2016 13:29:40 +0000", "message": "Authorization failed.", "data": null}

I am making following request

{
  "method": "get",
  "url": "https://api.pinterest.com/v1/me/boards",
  "headers": {
    "Authorization": "Bearer <valid-token-value-here>"
  },
  "qs": {
    "fields": "image,counts,created_at,description,url,name"
  }
}

I am passing above configuration to the request module.

Note: <valid-token-value-here> actually gets replaced by token while passing the configuration.

Can anyone suggest me what wrong i am doing here ?


回答1:


Finally, it turned out to be a silly mistake.

I was passing scope=undefined at time of authorization. After providing correct scope, APIs are working as expected.

@Zack Argyle Although not passing valid scope is client side issue, but i still feel, Pinterest should refuse the authorization in such cases.



来源:https://stackoverflow.com/questions/34613230/pinterest-api-giving-error-code-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!