【发布时间】:2016-07-19 05:40:06
【问题描述】:
我正在构建一个使用NPR One API 的应用程序。我无法获得回复,据我所知,没有关于此主题的任何帖子。
我使用npr-api 节点模块生成访问令牌,并且该过程似乎没有问题地工作。当我在 https://api.npr.org/stationfinder/v2/organizations 发出 GET 请求时,我不断收到 401 错误。我正在关注文档并包含指定的授权标头:
Authorization: Bearer ACCESS_TOKEN
我已将“ACCESS_TOKEN”替换为按照npr-api 模块文档中列出的步骤生成的代码。响应正文为:
{
“version”: “1.0”,
“href”: “http://api.npr.org/stationfinder/v2/organizations”,
“attributes”: {},
“items”: [],
“links”: {},
“errors”: [
{
“code”: 401885,
“text”: “Unauthorized”
}
]
}
我试过运行“试试看!”从 stationfinder 的详细 API 说明中进行测试,这也给了我相同的响应。
有其他人遇到过这个问题吗?
【问题讨论】:
标签: http-status-code-401 npr-api