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

Unable to get Box Authenticated Session

New post

Comments

2 comments

  • jcleblanc

    Hi ,

     

    It might help to see a full sample app with these features implemented. I have this sample set up with the start (redirect user) and return (code exchange) segments of the OAuth 2 process. That might help provide some context to the overall build.

     

    Let me know if you have any questions about that,

    Jon

    0
    Comment actions Permalink
  • hansari

    Hi there ,

     

    I really appreciate your quick response. I have managed to get authentication using the provided code and upload a file to my box account. now I wanted to create a shared link for the file. 

     

    var fileId = newFile.Id;
    var unshareAt = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 12, 0, 0);
    
    BoxSharedLinkRequest sharedLink = new BoxSharedLinkRequest()
    {
    Access = BoxSharedLinkAccessType.open,
    UnsharedAt = unshareAt,
    Permissions = new BoxPermissionsRequest
    {
    Download = true
    }
    };
    
    // Create shared link
    BoxFile file = await _boxClient.FilesManager.CreateSharedLinkAsync(fileId, sharedLink);
    

     

    I am getting exception on CreateSharedLinkAsync that 

     

    The API returned an error [BadRequest | raadfgg5sjey4lm0.01cnp3vkglp90cg7sijsis1t16d] bad_request - Bad Request

     

     Can you please guide me here ? I am understanding that for creating shared link boxclient is not required but adminclient is required. and for adminclient I need to auth my app using JWT authentication. Can I have the authority to perform both operations using boxclient? please guide me here.

    your support in this regard will be highly appreciated.

    0
    Comment actions Permalink

Please sign in to leave a comment.