cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

https://content.dropboxapi.com/2/files/get_preview issue 409

https://content.dropboxapi.com/2/files/get_preview issue 409

diego_gecko
New member | Level 2

Hello.

 

I'm trying to get a preview of files stored in shared Dropbox folder, I'm working on JS and I'm getting this error 409 : path not found.

This is my script::

var dropboxToken = "My_token";
$.ajax({
url: "https://content.dropboxapi.com/2/files/get_preview",
type: 'POST',
cache: false,
//dataType: 'json',
headers: {
'Authorization':'Bearer ' + dropboxToken,
'Content-Type': "application/octet-stream",
'Dropbox-API-Arg': JSON.stringify({
".tag": "path",
"path": "/Pruebas_liveChat/livechat-visual2+(5).pdf//",
}),
//"path": '/Pruebas_liveChat/livechat-visual2+(5).pdf',
},
error : function(err){
console.log(err);
},
success : function(code) {
console.log(code);
},

});

1 Reply 1

Greg-DB
Dropbox Staff
You can find the documentation for each of the errors for this endpoint here:

https://www.dropbox.com/developers/documentation/http/documentation#files-get_preview

For example, click on 'path' under 'PreviewError' to see that 'path/not_found' means "There is nothing at the given path", and 'path/not_file' means "We were expecting a file, but the given path refers to something that isn't a file.".

I recommend using /2/files/list_folder[/continue] to make sure you are using the correct paths:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?