You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

akirapix's avatar
akirapix
New member | Level 2
3 months ago

generation of preview for business user

Hello,

i developed an integration for our applications that allows user to create a sharing link using dropbox api method "sharingCreateSharedLink".

 

I tested it using some personal account and had no problem, but it does not work with a business account of a colleague.

 

this method takes two params: short_url and path

 

short_url is always false and path is the relative path of the file i want a preview for.

 

If a file resides in /Users/<user>/Dropbox/path1/path2/path3/file.pdf then "path" parameter will be "/path1/path2/path3/file.pdf"

 

I noticed, on this business account, that relative path on Dropbox is little different. Instead of being "/path1/path2/path3/file.pdf" is

"<user_name>/path1/path2/path3/file.pdf". 

 

I tried "sharingCreateSharedLink" passing as "path" parameter both "/path1/path2/path3/file.pdf" and "<user_name>/path1/path2/path3/file.pdf" but dropbox replies always with "path not found"

 

is there any difference between personal and business account i should be aware of?

 

thanks

 

 

 

 

 

 

  • Здравко's avatar
    Здравко
    Legendary | Level 20

    There are some differences. The devil is always in details. Did you follow: https://developers.dropbox.com/dbx-team-files-guide?

    Key moment is the difference between user home and account root! In some accounts (including all individual) they are the same thing, but that's not for all team account (in most cases they are different things).

    Hope this gives direction.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    akirapix Yes, as Здравко said, business accounts can be different; they may have a "team space". By default, API calls to the Dropbox API operate in the "member folder" of the connected account, not the "team space". That means that by default, the contents of the team space will not be found.

     

    You can configure API calls to operate in the "team space" instead though, in order to interact with files/folders in the team space. To do so, you'll need to set the "Dropbox-API-Path-Root" header. You can find information on how to use this in the Team Files Guide.

     

    By the way, sharingCreateSharedLink is deprecated in favor of sharingCreateSharedLinkWithSettings, so please use sharingCreateSharedLinkWithSettings if possible.

    • Здравко's avatar
      Здравко
      Legendary | Level 20

      Greg-DB wrote:

      ...

      By the way, sharingCreateSharedLink is deprecated in favor of sharingCreateSharedLinkWithSettings, so please use sharingCreateSharedLinkWithSettings if possible.


      It's mentioned already multiple times by different users here on the forum, but let me recall again. When somebody needs a link to be received and it doesn't need to be new one, using sharingCreateSharedLinkWithSettings is pretty inconvenient. For existing link, it throws an error, that may contain the existing link, but that's not guaranteed. So for simple task to just get a link, developer will need to implement logic chain that may leads to second API call (sharingListSharedLinks) - something meaningless on my opinion too. This could be resolved as single boolean flag addition on top args level - let's say named "only_new_link" that is optional and defaults to true - the current behavior, so everything would be full back-compatible without affecting existing SDKs. 😉

      I believe that in most cases, developers will set this flag to false, so a typical code (for typical use case) will be much simpler (and usually faster - not only possible, but guaranteed single API call for a link). Also, no need valid link to be received like an error as is now - much simpler code and easier error handling (real errors only).

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
326 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!