cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and 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: 

What is an api of dropbox to get content any files like pdf file , rtf file and etc?

What is an api of dropbox to get content any files like pdf file , rtf file and etc?

Arun_Bishwa
Explorer | Level 3
Go to solution

Hello All,

 

I am looking for v2 api to give only content of any files because when i use v2 api like download to get file using java, in response i would get content along with extra details like fond, alignment and other stubs details which i am not expecting. due to this it effects on my business logic.

 

Please guys suggest me best v2 api or way to get same requirement.

 

Thanks in advance !!!

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
The /2/files/download endpoint works the same way for all file types, in that it will just return the full file data it has for the requested file, in the HTTP response body. In these samples you're just printing out the raw data as text, but generally you'd want to open them in the relevant viewers, e.g., a PDF reader for PDF files, or a rich text reader/editor for RTF files.

Each of your screenshots shows the raw data for the files you're requesting. If the file contains more data than you're expecting, you'll need to look in to why that data was uploaded to Dropbox in the first place.

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

To access the Dropbox API from Java, we recommend using the official Dropbox API v2 Java SDK. With that, to download file content, you should use one of the download methods.

 

The Dropbox API will return the exact file data it recieved, i.e., as was uploaded to it. I don't know exactly what you mean by "fond, alignment and other stubs details", as those aren't Dropbox file attributes, so it sounds like they're part of the file data itself. We can't offer help with whatever file format(s) you're using, so you may need to refer to the documentation for the format(s) and/or update your code to handle the details of the format.

Arun_Bishwa
Explorer | Level 3
Go to solution

Thanks Greg K for your reply.

 

The issue i am expecting file's body while if i use dropbox sdk or dropbox v2 api.

for example like of pdf file once i download it, as reponse is in encode formate and rtf file concern along with body i get other extra details . Please see below snapshot.

 

Dropbox Api : https://content.dropboxapi.com/2/files/download

PDF File Response : Below snapshot

Screenshot (28).png

 

 

Dropbox Api : https://content.dropboxapi.com/2/files/download

RTF file Response : Below snapshot ...

 

 

Screenshot (29).pngThanks !!!

Greg-DB
Dropbox Staff
Go to solution
The /2/files/download endpoint works the same way for all file types, in that it will just return the full file data it has for the requested file, in the HTTP response body. In these samples you're just printing out the raw data as text, but generally you'd want to open them in the relevant viewers, e.g., a PDF reader for PDF files, or a rich text reader/editor for RTF files.

Each of your screenshots shows the raw data for the files you're requesting. If the file contains more data than you're expecting, you'll need to look in to why that data was uploaded to Dropbox in the first place.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Arun_Bishwa Explorer | Level 3
What do Dropbox user levels mean?