フォルダ内にウェブリンクオブジェクトを作成します。
curl -X POST https://api.box.com/2.0/web_links \
-H 'Authorization: Bearer <ACCESS_TOKEN>" '
-H 'Content-Type: application/json" '
-d '{
"name": "Cloud Content Management",
"url": "https://box.com",
"parent": {
"id": "0"
}
}'
var weblinkParams = new BoxWebLinkRequest()
{
Url = new Uri("http://www.example.com"),
Parent = new BoxRequestEntity()
{
Id = "22222"
}
};
BoxWebLink link = await client.WebLinksManager.CreateWebLinkAsync(weblinkParams);
BoxFolder folder = new BoxFolder(api, id);
URL url = new URL("https://www.example.com");
folder.createWebLink("Link to Example", url, "This goes to an example page");
web_link = client.folder(folder_id='12345').create_web_link('https://example.com', 'Example Link', 'This is the description')
print('Web Link url is {0} and its description is {1}'.format(web_link.url, web_link.description))
client.weblinks.create(
'https://www.box.com',
'22222',
{
name: 'Box Website!',
description: 'Cloud Content Management'
})
.then(weblink => {
/* weblink -> {
type: 'web_link',
id: '11111',
sequence_id: '0',
etag: '0',
name: 'Box Website!',
url: 'https://www.box.com',
created_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' },
created_at: '2015-05-07T15:00:01-07:00',
modified_at: '2015-05-07T15:00:01-07:00',
parent:
{ type: 'folder',
id: '22222',
sequence_id: '1',
etag: '1',
name: 'Bookmarks' },
description: 'Enterprise Cloud Content Management',
item_status: 'active',
trashed_at: null,
purged_at: null,
shared_link: null,
path_collection:
{ total_count: 2,
entries:
[ { type: 'folder',
id: '0',
sequence_id: null,
etag: null,
name: 'All Files' },
{ type: 'folder',
id: '22222',
sequence_id: '1',
etag: '1',
name: 'Bookmarks' } ] },
modified_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' },
owned_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' } }
*/
});