【发布时间】:2019-07-16 13:46:15
【问题描述】:
使用官方的 Vimeo PHP 库 (https://github.com/vimeo/vimeo.php)
尝试使用客户端库的 upload() 方法上传视频会返回以下 http 响应:
身份验证令牌缺少用户 ID,必须在上传视频时提供。
但是,在调用upload() 方法之前,Client Id、Client Secret 和 Token 都在客户端上设置:
客户端初始化:
$this->setClient(new Vimeo($this->clientId, $this->clientSecret, $this->token));
调用上传方法:
try{
$videoUri = $this->getClient()->upload($path, [
'name' => $name,
'privacy' => [
'view' => 'anybody'
]
]);
return $videoUri;
} catch (\Exception $e) {
dump($e);
return false;
}
有一个教程端点,我使用上面创建的客户端调用它并得到以下响应:
{
"message": "Success! You just interacted with the Vimeo API. Your dev environment is configured correctly, and the client ID, client secret, and access token that you provided are all working fine.",
"next_steps_link": "https://developer.vimeo.com/api/guides/videos/upload",
"token_is_authenticated": false
}
欢迎提出任何建议!
【问题讨论】:
-
clientId 与 userId 不同。 clientId 和 clientSecret 用于您创建的 API 应用程序,以便用户可以进行身份验证。我猜
upload()要求用户通过您的应用程序进行身份验证github.com/vimeo/vimeo.php#authenticated -
目的是上传到应用所属的账户,而不是经过身份验证的用户账户
-
没有线索,抱歉。 github.com/vimeo/vimeo.php/blob/master/example/upload.php 有一个上传示例,看看是否有帮助
-
这就是我遵循的说明! ??????