在读取 https://developer.vimeo.com/api/reference/channels#PUT/channels/{channel_id}/privacy/users时,看起来应该可以通过发送具有多个用户的正文来允许多个用户查看私人频道。
当我发出以下 cURL 时
curl -X PUT
https://api.vimeo.com/channels/1407898/privacy/users
-H 'Authorization: Bearer {bearer token}'
-H 'Cache-Control: no-cache'
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'Postman-Token: 8a5288c3-1352-4c90-8874-aa622930c4e7'
-d users=89969174
我回来了
{
"error": "Something strange occurred. Please try again.",
"link": null,
"developer_message": "The body of this HTTP request is not formatted properly. Please check the content-type header and raw body.",
"error_code": 2205
}
我不确定我做错了什么,在这里?
该端点的文档有点缺乏 - Vimeo 将很快修复它。
要添加多个用户,您需要发送一个对象数组:
curl -X PUT
https://api.vimeo.com/channels/*channel_id*/privacy/users
-H 'Accept: application/vnd.vimeo.*+json;version=3.4'
-H 'Authorization: bearer *token*'
-H 'Content-Type: application/json'
-d '[
{"uri":"/users/*userid1*"},{"uri":"/users/*userid2*"}
]
'