Returns the file represented by a shared link.
A shared file can be represented by a shared link, which can originate within the current enterprise or within another.
This endpoint allows an application to retrieve information about a shared file when only given a shared link.
The shared_link_permission_options array field can be returned
by requesting it in the fields query parameter.
This operation is performed by calling function findFileForSharedLink.
See the endpoint docs at API Reference.
await userClient.sharedLinksFiles.findFileForSharedLink(
{} satisfies FindFileForSharedLinkQueryParams,
{
boxapi: ''.concat(
'shared_link=',
fileFromApi.sharedLink!.url,
'&shared_link_password=Secret123@',
) as string,
} satisfies FindFileForSharedLinkHeadersInput,
);
FindFileForSharedLinkQueryParams
FindFileForSharedLinkHeadersInput
FindFileForSharedLinkOptionalsInputThis function returns a value of type FileFull.
Returns a full file resource if the shared link is valid and the user has access to it.
Gets the information for a shared link on a file.
This operation is performed by calling function getSharedLinkForFile.
See the endpoint docs at API Reference.
await client.sharedLinksFiles.getSharedLinkForFile(fileId, {
fields: 'shared_link',
} satisfies GetSharedLinkForFileQueryParams);
string
https://*.app.box.com/files/123 the file_id is 123. Example: “12345”GetSharedLinkForFileQueryParams
GetSharedLinkForFileOptionalsInputThis function returns a value of type FileFull.
Returns the base representation of a file with the additional shared link information.
Adds a shared link to a file.
This operation is performed by calling function addShareLinkToFile.
See the endpoint docs at API Reference.
await client.sharedLinksFiles.addShareLinkToFile(
fileId,
{
sharedLink: {
access: 'open' as AddShareLinkToFileRequestBodySharedLinkAccessField,
password: 'Secret123@',
} satisfies AddShareLinkToFileRequestBodySharedLinkField,
} satisfies AddShareLinkToFileRequestBody,
{ fields: 'shared_link' } satisfies AddShareLinkToFileQueryParams,
);
string
https://*.app.box.com/files/123 the file_id is 123. Example: “12345”AddShareLinkToFileRequestBody
AddShareLinkToFileQueryParams
AddShareLinkToFileOptionalsInputThis function returns a value of type FileFull.
Returns the base representation of a file with a new shared link attached.
Updates a shared link on a file.
This operation is performed by calling function updateSharedLinkOnFile.
See the endpoint docs at API Reference.
await client.sharedLinksFiles.updateSharedLinkOnFile(
fileId,
{
sharedLink: {
access:
'collaborators' as UpdateSharedLinkOnFileRequestBodySharedLinkAccessField,
} satisfies UpdateSharedLinkOnFileRequestBodySharedLinkField,
} satisfies UpdateSharedLinkOnFileRequestBody,
{ fields: 'shared_link' } satisfies UpdateSharedLinkOnFileQueryParams,
);
string
https://*.app.box.com/files/123 the file_id is 123. Example: “12345”UpdateSharedLinkOnFileRequestBody
UpdateSharedLinkOnFileQueryParams
UpdateSharedLinkOnFileOptionalsInputThis function returns a value of type FileFull.
Returns a basic representation of the file, with the updated shared link attached.
Removes a shared link from a file.
This operation is performed by calling function removeSharedLinkFromFile.
See the endpoint docs at API Reference.
await client.sharedLinksFiles.removeSharedLinkFromFile(
fileId,
{ sharedLink: createNull() } satisfies RemoveSharedLinkFromFileRequestBody,
{ fields: 'shared_link' } satisfies RemoveSharedLinkFromFileQueryParams,
);
string
https://*.app.box.com/files/123 the file_id is 123. Example: “12345”RemoveSharedLinkFromFileRequestBody
RemoveSharedLinkFromFileQueryParams
RemoveSharedLinkFromFileOptionalsInputThis function returns a value of type FileFull.
Returns a basic representation of a file, with the shared link removed.