如何生成 Vimeo 未经身份验证的访问令牌?

问题描述:

我是 Vimeo 的 api 的新手,我正在寻找一种方法来发出未经身份验证的请求.我发现我需要生成未经身份验证的访问令牌,但我不需要在 Vimeo 的 应用程序控制台 中看不到任何选项可以执行此操作.有人可以帮忙吗?

I am new to Vimeo's api, i am looking for a way to make unauthenticated requests. I find out that i will need to generate unauthenticated access token, but i don't see any option to do that in the Vimeo's apps console. Can anybody help?

应用程序页面尚不支持手动构建未经身份验证的访问令牌(即将推出!).现在,您必须以编程方式请求它们.

The app page does not yet support manual construction of unauthenticated access tokens (it's coming!). For now you have to request them programmatically.

幸运的是,它们不会过期,因此您只需生成一次.这是有关如何生成此令牌的快速演练.

Luckily, they don't expire, so you only have to generate it once. Here's a quick walk-through on how to generate this token.

  1. 从您的应用页面获取您的客户端 ID 和密码.
  2. 用中间的冒号将它们撞在一起(例如 abcd1234:edgh678)
  3. Base64 对整个字符串进行编码(您可以在线找到编码器、大量公共网站)
  4. 构建请求(您可以使用 curl、浏览器工具或您最喜欢的 http 请求工具).
    • HTTP 方法:POST
    • HTTP 网址:https://api.vimeo.com/oauth/authorize/client
    • HTTP 标头:授权:基本的
    • 请求正文:grant_type=client_credentials&scope=public%20private
  1. Grab your client id and secret from your app page.
  2. Slam them together with a colon in the middle (eg abcd1234:edgh678)
  3. Base64 encode that whole string (you can find encoders online, plenty of public websites)
  4. Construct the request (you can use curl, a browser tool, or your favorite http request tool).
    • HTTP Method: POST
    • HTTP URL: https://api.vimeo.com/oauth/authorize/client
    • HTTP Headers: Authorization: basic <your base 64 encoded token>
    • Request Body: grant_type=client_credentials&scope=public%20private