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