Create web link

post
https://api.box.com/2.0
/web_links

Creates a web link object within a folder.

Request

application/json

Request Body

stringin bodyoptional
Cloud Content Management

Description of the web link.

stringin bodyoptional
Box Website

Name of the web link. Defaults to the URL if not set.

objectin body

The parent folder to create the web link within.

stringnulloptional
0

The ID of parent folder

stringin bodyrequired
https://box.com

The URL that this web link links to. Must start with "http://" or "https://".

Response

application/jsonWeb link

Returns the newly created web link object.

application/jsonClient error

An unexpected client error.

post
Create web link
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
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"
       }
     }'
.NET
var weblinkParams = new BoxWebLinkRequest()
{
    Url = new Uri("http://www.example.com"),
    Parent = new BoxRequestEntity()
    {
        Id = "22222"
    }
};
BoxWebLink link = await client.WebLinksManager.CreateWebLinkAsync(weblinkParams);
Java
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");
Python
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))
Node
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' } }
		*/
	});