无法将多个用户放置到https://api.vimeo.com/channels/{channel_id}/privacy/users

时间:2018-09-26 22:30:53

标签: vimeo

在阅读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
}

我不确定我在做错什么吗?

1 个答案:

答案 0 :(得分:0)

该端点上的in this post有点不足-Vimeo会documentation

要添加多个用户,您需要发送对象数组:

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*"}
    ]

'