> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Web Link

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

To create a web link in Box, you will need to provide our API with a folder
`id` and the `url` you want the web link to be linked to. The `url` must start
with `http://` or `https://`.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -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"
         }
       }'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.webLinks.createWebLink({
    url: 'https://www.box.com',
    parent: { id: parent.id } satisfies CreateWebLinkRequestBodyParentField,
    name: getUuid(),
    description: 'Weblink description',
  } satisfies CreateWebLinkRequestBody);
  ```

  ```python Python v10 theme={null}
  client.web_links.create_web_link(
      "https://www.box.com",
      CreateWebLinkParent(id=parent.id),
      name=get_uuid(),
      description="Weblink description",
  )
  ```

  ```cs .NET v10 theme={null}
  await client.WebLinks.CreateWebLinkAsync(requestBody: new CreateWebLinkRequestBody(url: "https://www.box.com", parent: new CreateWebLinkRequestBodyParentField(id: parent.Id)) { Name = Utils.GetUUID(), Description = "Weblink description" });
  ```

  ```swift Swift v10 theme={null}
  try await client.webLinks.createWebLink(requestBody: CreateWebLinkRequestBody(url: "https://www.box.com", parent: CreateWebLinkRequestBodyParentField(id: parent.id), name: Utils.getUUID(), description: "Weblink description"))
  ```

  ```java Java v10 theme={null}
  client.getWebLinks().createWebLink(new CreateWebLinkRequestBody.Builder(url, new CreateWebLinkRequestBodyParentField(parent.getId())).name(name).description(description).build())
  ```

  ```java Java v5 theme={null}
  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 Python v4 theme={null}
  web_link = client.folder(folder_id='12345').create_web_link('https://example.com', 'Example Link', 'This is the description')
  print(f'Web Link url is {web_link.url} and its description is {web_link.description}')
  ```

  ```cs .NET v6 theme={null}
  var weblinkParams = new BoxWebLinkRequest()
  {
      Url = new Uri("http://www.example.com"),
      Parent = new BoxRequestEntity()
      {
          Id = "22222"
      }
  };
  BoxWebLink link = await client.WebLinksManager.CreateWebLinkAsync(weblinkParams);
  ```

  ```javascript Node v4 theme={null}
  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' } }
  		*/
  	});
  ```
</CodeGroup>

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Create web link"), href: "/reference/post-web-links", badge: "POST" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Delete Web Link"), href: "/guides/web-links/delete", badge: "GUIDE" }
]}
/>
