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

How to Validate File Name to Upload to Box from Salesforce

New post

Comments

6 comments

  • anonus3r

    Perhaps I should add more information?

     

    Should I use:

    • JWT with SDK
    • JWT with API
    • OAuthentication 2.0
    • Dev Token

    (Although, it looks like the documentation mentions that Dev Tokens are more for testing purposes. Please correct me if I am mistaken.)

     

    Which approach would be recommended? Any assistance would be greatly appreciated.

    0
    Comment actions Permalink
  • Kourtney

    Hello, 

     

    Thanks so much for using our Platform and Development Forum! 

     

    Could you please provide some more details about your use case? Are you trying to validate that the name doesn't already exist in your enterprise? 

     

    Best, 

    Kourtney

    0
    Comment actions Permalink
  • anonus3r

    Hi Kourtney,

     

    Thank you for your reply. We would like to make sure the file follows a naming convention before uploading (example: Hospital Bill John Doe MMDDYYYY.doc).

     

    Sincerely,

    Anon

    0
    Comment actions Permalink
  • Kourtney

    Hello, 

     

    Thanks so much for the clarification! 

     

    You will need to write some logic to check the file name before making the API call to box. Box doesn’t care about file names as long as there’s no conflicting file name in the same directory and that the characters used are valid. For example, if you want all file names to be “# account_name date” (where # is a number and date is a date in a specific format), you need to write that logic yourself and have a way to notify the user that they need to rename the file. Unfortunately, we won't be able to provide guidance on what that specific logic should look like. 

     

    Best, 

    Kourtney

    0
    Comment actions Permalink
  • anonus3r

    Hi Kourtney,

     

    Thank you for your reply. So, you and your developers suggest that I use JWT with API instead of JWT with SDK or OAuthentication 2.0?

     

    Sincerely,

    Anon

    0
    Comment actions Permalink
  • Kourtney

    Hello, 

     

    Choosing to use an SDK or not is completely up to you and your personal preference! If you are new to using the Box API and are familiar with our of the programming languages we offer an SDK for, I would definitely suggest using one to guide you. 

     

    As for whether to use standard oauth2 or JWT, that's dependant on your use case. I would recommend taking a look at the comparison chart on this page and dig a little deeper into our documentation on each to decide which is going to provide what you need!

     

    Best, 

    Kourtney 

    0
    Comment actions Permalink

Please sign in to leave a comment.