Vimeo API:无法上传视频-“未提供用户凭据".(8003) [英] Vimeo API: Can't upload video - "No user credentials were provided." (8003)

查看:77
本文介绍了Vimeo API:无法上传视频-“未提供用户凭据".(8003)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将视频从我的ReactJS应用程序上传到Vimeo,但是我收到了未提供用户凭证".错误(8003).

我从Vimeo API遵循了该指南:

如您所见,我确实具有上传权限.

我在做什么错了?

解决方案

如果您共享的访问令牌是您实际使用的令牌,则该令牌仅具有 public 范围,对此我进行了验证具有该令牌的/oauth/verify 终结点请求(文档在这里).

如果您张贴在帖子中的令牌是虚拟"邮件,令牌,以便在此处发布,然后使用您的真实令牌向该端点发出请求,并查看响应-如果它是https://developer.vimeo.com/api/upload/videos#form-approach

My code (for the first step of uploading a video):

const accessToken = "74a218e620507395c78219ab9421639c";

const size = form.file.size; // size of video in bytes

axios
  .post("https://api.vimeo.com/me/videos", {
    headers: {
      Accept: "application/vnd.vimeo.*+json;version=3.4",
      "Content-Type": "application/json",
      Authorization: "bearer " + accessToken,
    },
    upload: {
      approach: "post",
      size: size,
      redirect_url: "http://localhost:8083/success1",
    },
  })
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error);
    console.log(error.response);
  });

The response:

As you see I do have upload access.

What am I doing wrong?

解决方案

If the access token you shared is what you're actually using, the token only has public scope, which I verified by making a request with that token to /oauth/verify endpoint (docs here).

If the token you put in your post was a "dummy" token for the purposes of posting here, then make a request to that endpoint with your real token and take a look at the response -- if it's an unauthenticated (client_credentials) token, or if it's an authenticated token that doesn't have the scopes public private edit upload it cannot be used for upload.

这篇关于Vimeo API:无法上传视频-“未提供用户凭据".(8003)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆