登录时无法调用 vimeo api,注销时可以正常工作
Can't make vimeo api call when logged in, work when logged out
我已经实现了 Satellizer(https://github.com/sahat/satellizer)。
现在,当我登录时,任何 vimeo api 调用 returns
Failed to load resource: the server responded with a status of 401 (Authorization Required)
error:"You must provide a valid authenticated access token."
我不明白为什么即使 vimeo api 调用是正确的并且在上述错误消息旁边的 url 中有 access_token 也会发生这种情况。
https://api.vimeo.com/channels/staffpicks/videos?access_token=c57cd8d4fxxxxxx
Vimeo 没有在寻找访问令牌作为查询参数。当您像您一样将它添加到 url 时,它就是一个查询参数。您需要在授权中包含访问令牌 header。
在 GitHub 上,您可以找到一个 PHP 客户端库。根据我的经验,这使用起来非常简单。如果您不想设置您的请求,它开箱即用。这是图书馆:https://github.com/vimeo/vimeo.php
我已经实现了 Satellizer(https://github.com/sahat/satellizer)。
现在,当我登录时,任何 vimeo api 调用 returns
Failed to load resource: the server responded with a status of 401 (Authorization Required)
error:"You must provide a valid authenticated access token."
我不明白为什么即使 vimeo api 调用是正确的并且在上述错误消息旁边的 url 中有 access_token 也会发生这种情况。
https://api.vimeo.com/channels/staffpicks/videos?access_token=c57cd8d4fxxxxxx
Vimeo 没有在寻找访问令牌作为查询参数。当您像您一样将它添加到 url 时,它就是一个查询参数。您需要在授权中包含访问令牌 header。
在 GitHub 上,您可以找到一个 PHP 客户端库。根据我的经验,这使用起来非常简单。如果您不想设置您的请求,它开箱即用。这是图书馆:https://github.com/vimeo/vimeo.php