sharedLink URL
That's my code to create a sharedlink, (it's working) but the url is not the same url who i get on the web interface.
Someone had an idea ?
var client = new BoxClient(config, auth);
var file = File.OpenRead(localFilePath);
var fileRequest = new BoxFileRequest
{
Name = fileName,
Parent = new BoxFolderRequest { Id = parentFolderId }
};
// Normal file upload
var bFile = await client.FilesManager.UploadAsync(fileRequest, file);
BoxSharedLinkRequest sharedLink = new BoxSharedLinkRequest()
{
Access = BoxSharedLinkAccessType.open,
Password="7777"
};
BoxFile fsl = await client.FilesManager.CreateSharedLinkAsync(bFile.Id, sharedLink);
Uri url = await client.FilesManager.GetDownloadUriAsync(bFile.Id);
Uri embedUri = await client.FilesManager.GetPreviewLinkAsync(bFile.Id);
-
Hello ,
when you call the CreateSharedLink method, if you inspect the properties of a document, you see something like:
"shared_link": {
"url": "https://app.box.com/s/el9nz2ayhh6qwrg4vgkhve6kgukjxxxx",
"download_url": "https://app.box.com/shared/static/el9nz2ayhh6qwrg4vgkhve6kgukxxxx.png",
...
}That URL matches the one in the UI.
Maybe are you comparing with the other URL generated by GetPreviewLinkAsync method?
Thanks!
Please sign in to leave a comment.
Comments
1 comment