Jiayang Fan
Jiayang Fan

Reputation: 31

Privacy setting does not change when using Vimeo API

The video uploaded via the new API used the "video name" but the privacy setting doesn't change (I need it to be disabled from vimeo.com but can be embedded from other sites).

$video_data = $vimeo->request($uri, array(
    'name' => 'video name',
    'privacy' => array(
        'view' => 'disabled', 
        'embed' => 'anywhere'
    )
), 'PATCH');

Does anyone know why it's not working?

I find an alternative way to do this by changing the global defaul settings: https://vimeo.com/settings/videos

Many thanks

Upvotes: 3

Views: 1509

Answers (2)

Rafa0809
Rafa0809

Reputation: 1752

The correct request is:

// The docs refer to the following as "privacy.view"
array('privacy' => array('view' => 'disable'));

From https://github.com/vimeo/vimeo.php:

NOTE: How to use the PHP library with the Vimeo Docs.

The API docs often uses dot notation to represent a hierarchy of data (eg. privacy.view). Because this library sends all data using JSON, you must use nested associative arrays, not dot notation.

Upvotes: 1

Dashron
Dashron

Reputation: 3998

The value is "disable" not "disabled". You can see our docs here

Upvotes: 0

Related Questions