ファイルに共有リンクを追加します。
新しい共有リンクが追加されている、ファイルの基本レプリゼンテーションを返します。
Authorization
ヘッダーで指定されているアクセストークンが認識されないか、指定されていない場合に返されます。
ユーザーに更新を完了するための権限が一部しかない場合に返されます。
ファイルが見つからない場合、またはユーザーにファイルへのアクセス権限が与えられていない場合に返されます。
file_id
が認識されていない形式で指定されている場合に返されます。
If-Match
ヘッダーがファイルの現在のetag
値と一致しない場合にエラーを返します。これは、ファイルが前回リクエストされたときから変更されていることを示します。
予期しないクライアントエラー。
curl -i -X PUT "https://api.box.com/2.0/files/32423234?fields=shared_link" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"shared_link": {
"access": "open",
"password": "mypassword",
"unshared_at": "2012-12-12T10:53:43-08:00",
"permissions": {
"can_download": false
}
}
}'
file_id = '11111'
url = client.file(file_id).get_shared_link(access='open', allow_download=False)
print('The file shared link URL is: {0}'.format(url))
client.folders.update('12345', {
shared_link: {
access: client.accessLevels.COMPANY,
permissions: {
can_download: true
}
}
}).then(folder => {
// ...
})
{
"id": "12345",
"type": "file",
"etag": "1",
"shared_link": {
"url": "https://app.box.com/s/kwio6b4ovt1264rnfbyqo1",
"download_url": "https://app.box.com/shared/static/kwio6b4ovt1264rnfbyqo1.pdf",
"vanity_url": null,
"vanity_name": null,
"effective_access": "open",
"effective_permission": "can_download",
"is_password_enabled": false,
"unshared_at": "2020-09-21T10:34:41-07:00",
"download_count": 0,
"preview_count": 0,
"access": "open",
"permissions": {
"can_preview": true,
"can_download": true
}
}
}