Max_T
August 16, 2022, 8:42am
1
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
Jon
August 16, 2022, 9:26am
2
Hey @Max_T ,
I have not tried it, does the command work if you run it in curl?
1 Like
Max_T
August 16, 2022, 9:43am
3
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"}}”
Jon
August 16, 2022, 9:46am
4
Have you sent the Bearer value as well and just removed it?
1 Like
Max_T
August 16, 2022, 9:52am
5
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
Max_T
August 16, 2022, 10:07am
6
“httpCode”: “401”,
“description”: “missing_scope/.”
Jon
August 16, 2022, 10:08am
7
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
Max_T
August 16, 2022, 10:32am
8
I replace it with /SZOtestowe/Polonez.jpg
Max_T
August 16, 2022, 11:39am
12
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
Jon
August 16, 2022, 11:41am
13
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
Max_T
August 16, 2022, 11:46am
14
Does it matter if I don’t use an access token? Basically yes, to be sure, I can do it again.
Jon
August 16, 2022, 12:13pm
15
Looking at the Dropbox documentation you will need some kind of access token for the request to work.
1 Like
Max_T
August 16, 2022, 12:27pm
16
How do I have to configure the http module to be able to use the dropbox access token?
Jon
August 16, 2022, 3:23pm
17
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
Max_T
August 17, 2022, 11:19am
19
I set the same but unfortunately I got a 404 error on the connection itself
Jon
August 17, 2022, 12:56pm
20
Is that when it redirects or at another point like running the workflow?
1 Like
Max_T
August 18, 2022, 6:12am
21
I think so. How do I insert all the elements and press the button to connect to the dropbox.