Creating links to files on the dropbox

curl -X POST https://content.dropboxapi.com/2/sharing/get_shared_link_file
–header "Authorization: Bearer "
–header "Dropbox-API-Arg: {"path":"/Prime_Numbers.txt","url":"Dropbox - Error

{
“path”: “/Prime_Numbers.txt”,
“url”: “Dropbox - Error
}

hello I have this curl code. Has anyone ever used it? I’m having trouble getting a link to the file. probably the bug is in the part where I need to insert json code

Hey @Max_T,

I have not tried it, does the command work if you run it in curl?

1 Like

in general, I was wrong because this is the code.yes but not work.

curl -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings
–header "Authorization: Bearer "
–header “Content-Type: application/json”
–data “{"path":"/Prime_Numbers.txt","settings":{"access":"viewer","allow_download":true,"audience":"public","requested_visibility":"public"}}”

Have you sent the Bearer value as well and just removed it?

1 Like

the automation connects to the dropbox because I can get the file list. while there is a problem in the jet json part I think

“httpCode”: “401”,

“description”: “missing_scope/.”

So that could do it, You may need to add an extra scope when you get your token. Looks like you will need sharing.write.

Do you also have a Prime_Numbers.txt file in the path you are sending?

1 Like

I replace it with /SZOtestowe/Polonez.jpg

/list_folder

to connect I used: App key, App secret because it’s easier to insert. However, I do not know how to insert an access token in n8n with a dropbox

It looks to be ok, I wonder why Dropbox is saying you are missing a scope. Did you create a new token after adding the sharing.write scope?

1 Like

Does it matter if I don’t use an access token? Basically yes, to be sure, I can do it again.

Looking at the Dropbox documentation you will need some kind of access token for the request to work.

1 Like

Zrzut ekranu 2022-08-16 142254 How do I have to configure the http module to be able to use the dropbox access token?

Best option would be to use the OAuth2 credential type so something like this…

Then in your HTTP Request node you can use that credential and it should automatically handle a lot of the more complicated bits.

1 Like

I set the same but unfortunately I got a 404 error on the connection itself

Is that when it redirects or at another point like running the workflow?

1 Like

I think so. How do I insert all the elements and press the button to connect to the dropbox.