如何通过API(PHP)更改Vimeo的视频隐私?

时间:2018-08-29 15:15:11

标签: php request privacy vimeo-api

我正在尝试通过API(v3.4)请求设置Vimeo的视频隐私。

发送HTTP PATCH到https://api.vimeo.com/videos/{videoId}

标题:

"Authorization" => $api_key,
"Accept" => "application/vnd.vimeo.*+json;version=3.4"

身体:

"form_params" => array(
    "privacy" => array(
        "embed" => "public"
     ),
     "name" => $video_name,
     "description" => $video_description
 )

...正确更改了视频的名称和说明(API令牌具有编辑权限),但隐私设置保持不变。

我已经按照Vimeo的API文档指定的每个步骤进行了操作,但无法正常工作。我在做什么错了?

1 个答案:

答案 0 :(得分:0)

privacy字段实际上是privacy.{key}。 因此,正确的代码是

"form_params" => array(
    "privacy.embed": "public"
    "name" => $video_name,
    "description" => $video_description
)