cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get a folders public link using the dropbox API in Azure logic apps

Get a folders public link using the dropbox API in Azure logic apps

Jeff B.63
Collaborator | Level 8
Go to solution

We use Dropbox to store pictures from every jobsite we work on.  The estimator puts his pics in the folder for the crews to view and later the crews put their images in the same folder.  I have been using an Azure logic app to create the folders I need by using a constructed folder path and creating a txt file. I then delete the file afterwards.   But I can't find any way to get the public link for the folder using Logic Apps. 

 

 

I can do it in Zappier but that just gets stupid expensive in short order. 

 

Has anyone found a way to get the public link?

24 Replies 24

Jeff B.63
Collaborator | Level 8

Yes, sorry, I accidentally used the local path when creating the post but I have been using the correct path in my testing.  

 

I have looked through the documentation as well as used the API Explorer.  

The code produced by it under HTTP is:

POST /2/sharing/create_shared_link_with_settings
Host: https://api.dropboxapi.com
User-Agent: api-explorer-client
Authorization: *sanitized*
Content-Type: application/json

{
    "path": "\\~ Pictures - All\\Share Link Testing\\1"
}

 

When I look at the JSON for the Query in the HTTP step, it is identical to what the Explorer is showing.

JeffB63_0-1706114228122.png

 

Greg-DB
Dropbox Staff

@Jeff B.63 I see you have changed the parameter data to be JSON, but you still have it in the "Queries" section for your client. I can't offer support for your client itself, but it appears your client sends that as URL parameters. That JSON needs to be sent in the request body, so you probably need to put that in the "Body" section instead.

 

Also, the path value itself still doesn't look correct. It looks like you would want something like this:

"/~ Pictures - All/Share Link Testing/1"

Jeff B.63
Collaborator | Level 8

Thank you for your help.  I was able to get it working finally.  I am just not sure which reply to mark as the answer.

Jeff B.63
Collaborator | Level 8

My next quandary is keeping or refreshing the token so it doesn't expire.  Can you point me in the right direction?

Greg-DB
Dropbox Staff

@Jeff B.63 Dropbox issues short-lived access tokens which expire after a few hours. Apps can get long-term access by requesting "offline" access, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. Refresh tokens do not expire automatically and can be used repeatedly. You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.

Jeff B.63
Collaborator | Level 8

The example in the blog uses curl but I need HTTP.  I tried the online conversion tool from GitHub but it just gets syntax errors.  I have my AppKey and AppSecret but what is the authorization code and do I need a redirect URI since I want the response to come right back to the HTTP request?

Здравко
Legendary | Level 20

@Jeff B.63 wrote:

The example in the blog uses curl but I need HTTP.  I tried the online conversion tool from GitHub but it just gets syntax errors.  ...


Hi @Jeff B.63,

You can add -v option (verbose) in every curl command and you'll get entire HTTP request in the console output as is. :winking_face:

 


@Jeff B.63 wrote:

...  I have my AppKey and AppSecret but what is the authorization code and do I need a redirect URI since I want the response to come right back to the HTTP request?


The authorization code is something you should receive from the authorization page where you (or your application user - whoever is) grant permission to access account resources. It can be copied by hand or received automatic using redirect URI - the choice is yours. So, no, it's not mandatory usage of redirect URI. Take a look here how you can perform the same without redirect URI.

Hope this helps.

Jeff B.63
Collaborator | Level 8

I just tried the first step in your instructions and the browser returned an error "invalid client id".

Do I need to apply for production on the App or something?

 

Здравко
Legendary | Level 20

@Jeff B.63 wrote:

...

Do I need to apply for production on the App or something?


No. Probably mistake in copy/paste.

I just tried too and everything works. Make sure you copy your client ID correct - even one symbol messed and... you saw the result. 🙋

Jeff B.63
Collaborator | Level 8

Thanks Здравко, It was because I left the brackets in.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Jeff B.63 Collaborator | Level 8
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?