Welcome to the new Box Support website. Check out all the details here on what’s changed.

Retrieving the sharedLink URL for the uploaded file via the logged in app user?

New post

Comments

1 comment

  • Murtza

    After uploading the file, you would have to make an API call to create a shared link for that file. In the response to this API call, you will get the shared link for the file.

     

    Here's the documentation for the Create Shared Link endpoint.

     

    Here's sample code showing how to call the Create Shared Link endpoint using the Box iOS SDK.

     

     

    BOXContentClient *contentClient = [BOXContentClient defaultClient];
    BOXFileShareRequest *shareRequest = [contentClient sharedLinkCreateRequestForFileWithID:@"file-id"];
    
    // Optional: Customize the shared link to be created
    shareRequest.accessLevel = BOXSharedLinkAccessLevelCompany;
    shareRequest.expirationDate = [NSDate dateWithTimeInterval:3600 sinceDate:[NSDate date]];
    shareRequest.canDownload = NO;
    shareRequest.canPreview = YES;
    
    [shareRequest performRequestWithCompletion:^(BOXFile *file, NSError *error) {
        // You can confirm creation of the shared link through the sharedLink 
        // property of the BOXFile that is returned.
        NSLog(@"Shared link URL: %@", file.sharedLink.url);
    }]; 

     

    0
    Comment actions Permalink

Please sign in to leave a comment.