This API is for both OfficeDrop and PaperPort Anywhere - develop for one and get both document management integrations! We are also working our our API License Agreement, and welcome any comments you might have on it.
We are committed to helping our developer partners grow their business. This includes using our blog, social media, montly email newsletters and press reach to help make your integration a success. Contact healy (at) officedrop (dot) com to learn more.
This document describes the API calls available for applications that want to access an OfficeDrop account.
Contents
OfficeDrop API calls document................................................................................................................ 2
OfficeDrop and Amazon S3..................................................................................................................... 5
Authentication mechanisms.................................................................................................................... 6
HTTP Basic authentication................................................................................................................... 6
OAuth authentication......................................................................................................................... 6
Validating user credentials...................................................................................................................... 9
User Registration.................................................................................................................................. 11
Recovering a lost username.................................................................................................................. 13
Recovering a lost password................................................................................................................... 14
Documents Resource............................................................................................................................ 15
Documents list and search................................................................................................................. 15
View a single document.................................................................................................................... 17
Documents search............................................................................................................................ 18
Opening a document with highlights.................................................................................................. 23
Sample Response.......................................................................................................................... 23
Uploading a document...................................................................................................................... 26
Deleting documents.......................................................................................................................... 28
Undeleting documents...................................................................................................................... 28
View documents in trash................................................................................................................... 29
Purging documents........................................................................................................................... 31
Listing documents without folder (documents at the user’s home folder).......................................... 32
Favorite documents.............................................................................................................................. 35
Marking a single document as a favorite............................................................................................ 35
Listing all favorite documents for a user............................................................................................. 35
Removing a document from your favorites list................................................................................... 37
Marking many documents as favorites............................................................................................... 37
Unfavoriting many documents.......................................................................................................... 38
Getting a list of ids of the documents the user has favorite................................................................ 38
Batches resource.................................................................................................................................. 40
Getting a specific batch..................................................................................................................... 40
Listing batches.................................................................................................................................. 41
Folders Resource.................................................................................................................................. 47
Listing folders.................................................................................................................................... 47
Creating a new folder........................................................................................................................ 48
Updating a folder’s information......................................................................................................... 49
Deleting a folder............................................................................................................................... 49
Moving a document to a folder.......................................................................................................... 49
Move a list of documents to a folder.................................................................................................. 49
Label Resource..................................................................................................................................... 51
List all labels...................................................................................................................................... 51
Create a label.................................................................................................................................... 51
Update a label................................................................................................................................... 52
Delete a label.................................................................................................................................... 52
Delete many labels at the same time................................................................................................. 52
Apply labels for a set of documents................................................................................................... 53
Remove labels from a set of documents............................................................................................ 53
Artifacts................................................................................................................................................ 55
Downloading the document in PDF format......................................................................................... 55
Downloading the original document uploaded to OfficeDrop.............................................................. 55
The page in the “display” format........................................................................................................ 56
The page in the “thumbnail” format................................................................................................... 56
The page in the “snippet_full” format................................................................................................ 56
The page in full resolution................................................................................................................. 57
Sharing a resource................................................................................................................................ 58
Shared documents............................................................................................................................ 59
Shared folders.................................................................................................................................. 61
Glossary............................................................................................................................................... 63
All files and resources that you send to OfficeDrop are processed and then stored at the S3 service at Amazon. For security reasons, theses files are always saved as private objects, there’s no way for an external entity access those files directly.
The only way to let an external party to access one of those files is to give them a signed S3 url for that specific file. Signed S3 URLs have an expiration time set on them, so you can not store them forever as once they expire you will not be able to access the resource again. Throughout this API document you will notice that there are various URLs to download files that point to the OfficeDrop website, these URLs are, in fact, bridges. They will not give you the file stored in S3, they’ll generate a signed URL and will then redirect you to that URL.
So, when calling the OfficeDrop API and trying to download files, be it document images or document files, you must remember to tell your HTTP library to follow the redirect or you will not be able to access the file. Also, you should never cache these signed URLs, as they will expire and you will not be able to access the document anymore, you should always store the bridge URL at your end and never the S3 signed URL.
Imagine that you’re trying to download a full page version of the first page of a document, this is the URL you would call to get it:
https://www.officedrop.com/ze/api/documents/1099/pages/1/display
The response to this request would be a redirect to this URL:
And with this URL you would finally access the page information.
All calls to the API should be done over HTTPS connections to keep user information protected over connections.
Most of the API calls require the user to be authenticated to the application, this can be done in various ways but they all lead to the same idea, the user must say who he is to the application so we can load the correct information for his account. Right now the supported authentication methods are HTTP Basic Auth and OAuth.
By default, you can expect all calls to require authentication, unless the specific API documentation says that the call doesn’t require it.
All calls that require authentication can use the authentication methods provided below:
When using HTTP Basic you just have to send the username and password for the OfficeDrop account at the HTTP Basic headers.
Sample CURL call:
curl -u "johnsmith:123456" https://www.officedrop.com/api/folders.xml
Our request token path is at https://www.officedrop.com/oauth/request_token and the access token path is at https://www.officedrop.com/oauth/access_token.
The first step to start using the OfficeDrop API via OAuth is signing up for OfficeDrop (at http://www.officedrop.com/ ) and registering an Application, this is where you get the OAuth consumer token and secret to start making OAuth calls to our service.
Sign up for OfficeDrop and at the first page click on the “Account” option:
After clicking at the “Account” you should click at the OAuth Applications option:
In the next page select “Register Your Application”:
Fill in your application details:
And at the final step you’ll see the OAuth token and secret values:
URL: https://{server_host}/ze/api/session.xml
Method: POST
Parameters:
If HTTP Basic authentication is going to be used:
This call does not require authentication.
Sample curl request:
curl -v -d "username=johnsmith&password=123456" https://www.officedrop.com/ze/api/session.xml
Success response:
<?xml version="1.0" encoding="UTF-8"?>
<user>
<customer-name>John Smith</customer-name>
<email>johnsmith@mail.com</email>
<id>111</id>
<username>johnsmith</username>
<accounts>
<account>
<domain-prefix>johnsmith-account</domain-prefix>
<id>111</id>
<name>John Smith Account</name>
<number>123456</number>
</account>
</accounts>
</user>
Error response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>403</code>
<message>Incorrect username or password </message>
<status>error</status>
</message>
A success response for this request assures the caller that the user with the credentials provided exists and has an account (or more than one) enabled on OfficeDrop.
URL: https://{server_host}/ze/api/users.xml
Method: POST
Parameters:
Sample CURL call:
curl -d "user[username]=john&user[customer_name]=john&user[password]=12345678&user[email]=john@mail.com" https://www.officedro.com/ze/api/users.xml
Sample success response:
<?xml version="1.0" encoding="UTF-8"?>
<user>
<customer-name>John Smith</customer-name>
<email>johnsmith@mail.com</email>
<id>117</id>
<username>johnsmith</username>
</user>
Sample error response:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error attribute="customer_name">
<![CDATA[can't be blank]]>
</error>
<error attribute="username">
<![CDATA[can't be blank]]>
</error>
<error attribute="username">
<![CDATA[should be 4 characters or more]]>
</error>
<error attribute="username">
<![CDATA[should include only letters, numbers and underscores (minimum size: 3 characters)]]>
</error>
<error attribute="password">
<![CDATA[can't be blank]]>
</error>
<error attribute="email">
<![CDATA[can't be blank]]>
</error>
</errors>
URL: https://{server_host}/ze/api/reminder/username.xml
Parameters:
Sample curl call:
curl -d "email=johnsmith@mail.com" https://www.officedrop.com/ze/api/reminder/username.xml
Sample success response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>Your username has been emailed to you.</message>
<status>success</status>
</message>
Sample error response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>400</code>
<message>The details provided were not correct. Please try again.</message>
<status>error</status>
</message>
URL: https://{server_host}/api/reminder/password.xml
Parameters:
Sample curl call:
curl -d "email=johnsmith&username=johnsmith" https://www.officedrop.com/api/reminder/password.xml
Sample success response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message> Instructions on how to continue to reset your password have been sent to your email address.</message>
<status>success</status>
</message>
Sample error response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>400</code>
<message>The details provided were not correct. Please try again.</message>
<status>error</status>
</message>
This is the call you will do to show documents to the user and also to search for documents or filter them using folder, label or favorites information.
URL: https://{server_host}/ze/api/documents.xml
Method: GET
Parameters:
Sample curl request:
curl -v -u "johnsmith:123456" https://www.officedrop.com/ze/api/documents.xml?page=1&per_page=5
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<documents>
<pagination>
<current-page>1</current-page>
<per-page>15</per-page>
<total-entries>2</total-entries>
<total-pages>1</total-pages>
</pagination>
<document>
<cover>https://www.officedrop.com/ze/api/documents/1159/cover</cover>
<download>https://www.officedrop.com/ze/api/documents/1159/download</download>
<id>1159</id>
<name>OfficePad_Prioritized_Wishlist.pdf</name>
<page-count>1</page-count>
<labels>
<label>
<id>5</id>
<name>api testing</name>
</label>
</labels>
<folder>
<id>4</id>
<name>Default</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
</document>
<document>
<cover>https://www.officedrop.com/ze/api/documents/1153/cover</cover> <download>https://www.officedrop.com/ze/api/documents/1153/download</download>
<id>1153</id>
<name>Draft for newcomers.pdf</name>
<page-count>7</page-count>
<labels>
<label>
<id>5</id>
<name>api testing</name>
</label>
</labels>
<folder>
<id>4</id>
<name>Default</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
</document>
</documents>
This response represents the document basic information, the fields cover and download are bridge URLs that will redirect the requestor to an signed Amazon S3 URL where the document really lives, so, the HTTP library that requests this URL should be able to follow HTTP redirect responses (307 HTTP code). Check the beginning of the document for a full explanation on bridge URLs and S3.
The documents are always returned using pagination and the pagination data is also part of the XML response so client applications can show the user pagination widgets when listing documents.
URL: https://{server_host}/ze/api/documents/[document_id].xml
Method: GET
Sample curl request:
curl -v -u "johnsmith:123456" https://www.officedrop.com/ze/api/documents/1024.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<document>
<batch-type>UPLOAD</batch-type>
<cover>https://www.officedrop.com/ze/api/documents/1159/cover</cover>
<created-at>2010-02-27T15:18:01Z</created-at>
<download>https://www.officedrop.com/ze/api/documents/1159/download</download>
<id>1159</id>
<name>OfficePad_Prioritized_Wishlist.pdf</name>
<page-count>1</page-count>
<updated-at>2010-02-27T15:18:31Z</updated-at>
<view-count>0</view-count>
<labels>
<label>
<id>5</id>
<name>api testing</name>
</label>
</labels>
</document>
URL: https://{server_host}/ze/api/documents/search.xml
Method: GET
Parameters:
Sample curl request:
curl -v -u "user111:password" --basic localhost:3000/api/documents/search.xml?page=1&per_page=5&q=pixily&label_ids=12,45,95&folder_id=4
Sample response:
<documents>
<pagination>
<current-page>1</current-page>
<per-page>3</per-page>
<total-entries>1</total-entries>
<total-pages>1</total-pages>
</pagination>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-03-18T12:05:04Z</created-at>
<download>http://localhost:3000/ze/api/documents/1086/download</download>
<id>1086</id>
<name>rsync.pdf</name>
<page-count>6</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-03-18T12:05:29Z</updated-at>
<view-count>0</view-count>
<labels>
<label>
<id>5</id>
<name>api testing</name>
</label>
</labels>
<folder>
<id>34</id>
<name>Home</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
<page-hits>
<page-hit>
<display>http://localhost:3000/ze/api/documents/1086/page/1/display</display>
<number>1</number>
<size>2480x3508</size>
<thumbnail>http://localhost:3000/ze/api/documents/1086/page/1/thumbnail</thumbnail>
<rectangles>
<rectangle>1078,740,1230,669</rectangle>
<rectangle>667,2757,764,2715</rectangle>
<rectangle>609,2708,706,2666</rectangle>
</rectangles>
</page-hit>
</page-hits>
</document>
</documents>
Response details.
/documents/document/page-hits/page-hit: each <page-hit> object contains information about the terms found in a single page, you can use this information to show the page with highlights at the positions defined in the <rectangles> definition.
/documents/document/page-hits: a set of page-hit , for this first search just one per page will show up
/documents/document/page-hits/page-hit/number: page number
/documents/document/page-hits/page-hit/fetch: URL to get the document with word geometries.
/documents/document/page-hits/page-hit/thumbnail: thumbnail page of <number/>
/documents/document/page-hits/page-hit/display: display page of <number/> to position <rectangles/>
/documents/document/page-hits/page-hit/size: page size (width/sizeX)x(height/sizeY)
/documents/document/page-hits/page-hit/rectangles: set of rectangles to highlight each word.
Highlight positioning
This call is meant to be done after you performed a search and now you want to show the document highlighting the places where the words searched show up on it. As you get images of the pages when viewing them, you need the coordinates at the <page-hit> object to be able to highlight these positions at the image, opening a document with highlights will give you a document with all the <page-hit> information.
URL: http://{server_host}/ze/api/documents/{document id}/fetch.xml
Method: GET
Parameters:
The server will keep the last search result documents in cache so the fetch action will get the document with highlights.
Sample curl request:
curl -v -u "user111:password" --basic localhost:3000/ze/api/documents/1155/fetch.xml?q=foo
<?xml version="1.0" encoding="UTF-8"?>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-03-18T12:05:04Z</created-at>
<download>http://localhost:3000/ze/api/documents/1086/download</download>
<id>1086</id>
<name>rsync.pdf</name>
<page-count>6</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-03-18T12:05:29Z</updated-at>
<view-count>0</view-count>
<folder>
<id>34</id>
<name>Home</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
<page-hits>
<page-hit>
<display>http://localhost:3000/ze/api/documents/1086/page/1/display</display>
<number>1</number>
<size>2480x3508</size>
<thumbnail>http://localhost:3000/ze/api/documents/1086/page/1/thumbnail</thumbnail>
<rectangles>
<rectangle>1078,740,1230,669</rectangle>
<rectangle>667,2757,764,2715</rectangle>
<rectangle>609,2708,706,2666</rectangle>
</rectangles>
</page-hit>
<page-hit>
<display>http://localhost:3000/ze/api/documents/1086/page/2/display</display>
<number>2</number>
<size>2480x3508</size>
<thumbnail>http://localhost:3000/ze/api/documents/1086/page/2/thumbnail</thumbnail>
<rectangles>
<rectangle>1231,2483,1328,2441</rectangle>
<rectangle>667,993,764,951</rectangle>
<rectangle>758,753,915,694</rectangle>
</rectangles>
</page-hit>
<page-hit>
<display>http://localhost:3000/ze/api/documents/1086/page/4/display</display>
<number>4</number>
<size>2480x3508</size>
<thumbnail>http://localhost:3000/ze/api/documents/1086/page/4/thumbnail</thumbnail>
<rectangles>
<rectangle>1366,2915,1448,2881</rectangle>
<rectangle>1333,2218,1430,2176</rectangle>
</rectangles>
</page-hit>
<page-hit>
<display>http://localhost:3000/ze/api/documents/1086/page/5/display</display>
<number>5</number>
<size>2480x3508</size>
<thumbnail>http://localhost:3000/ze/api/documents/1086/page/5/thumbnail</thumbnail>
<rectangles>
<rectangle>1619,2308,1716,2266</rectangle>
</rectangles>
</page-hit>
<page-hit>
<display>http://localhost:3000/ze/api/documents/1086/page/6/display</display>
<number>6</number>
<size>2480x3508</size>
<thumbnail>http://localhost:3000/ze/api/documents/1086/page/6/thumbnail</thumbnail>
<rectangles>
<rectangle>924,657,1021,615</rectangle>
</rectangles>
</page-hit>
</page-hits>
</document>
URL: https://{server_host}/ze/api/documents.xml
Method: POST
Parameters:
When making this call remember to format all fields as multipart attachments and change the request content type to “multipart/form-data”.
Sample curl request:
curl -v -u "johnsmith:123456" -F "uploaded_data=@/home/johnsmith/pixily-test-18.pdf;type=application/pdf" -F "folder_id=4" https://www.officedro.com/ze/api/documents.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<batch>
<batch-status>RECEIVED</batch-status>
<batch-type>UPLOAD</batch-type>
<content-type>application/pdf</content-type>
<download>20100302012518_3767431117.pdf</download>
<extract-type>text</extract-type>
<id>1457445978</id>
<name>pixily-test-18.pdf</name>
<size>19321</size>
<documents/>
<folder>
<id>4</id>
<name>Default</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
<user>
<customer-name>John Smith</customer-name>
<email>johnsmith@mail.com</email>
<id>3154</id>
<username>johnsmith</username>
</user>
</batch>
When a document is uploaded, you will not receive a document object back from the controller but a <batch/> object that represents the future document. A batch represents that the document is being prepared for processing, once the batch reaches the READY_FOR_USER state (on the <batch-status/> attribute) the document is ready to be used (and the batch will point to it).
A client application can keep on requesting the information about the batch (using the batch id) to figure out if the document is ready (or if the batch failed). If the batch is failed with the following statuses CANCELLED, ABANDONED, DUPLICATE, it cannot be retried again. You can get more information about batches and their statuses on the Batches section of this document.
URL: https://{server_host}/ze/api/documents/delete.xml
Method: POST
Authentication required: Yes
Parameters:
This call marks a document as deleted and moves it to the trash, this call doesn’t delete the document forever, there’s another call, “purge”, that will do that. This document will not be available again at the general documents listing call, it will only show up at the trashed documents listing.
Sample curl call:
curl -v -u "johnsmith:123456" -d “document_ids=1149,1150” https://www.officedrop.com/ze/api/documents/delete.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>Documents successfully moved to the trash</message>
<status>success</status>
</message>
URL: https://{server_host}/ze/api/documents/undelete.xml
Method: POST
Authentication required: Yes
Parameters:
This call will “undelete” a document (ie. get a deleted document and move it out of the trashed documents listing). After being undeleted the document will show up again on the main documents listing calls.
Sample curl call:
curl -v -u "johnsmith:123456" -d “document_ids=1159,1160” https://www.officedrop.com/ze/api/documents/undelete.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>Documents successfully moved out of the trash</message>
<status>success</status>
</message>
URL: https://{server_host}/ze/api/documents/trashed.xml
Method: GET
Authentication required: Yes
This call returns all documents that were marked as “deleted” by the application (documents that received a “delete” call). This is the only place you can view deleted documents.
Sample curl call:
curl -v -u "johnsmith:123456" https://www.officedrop.com/ze/api/documents/trashed.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<documents>
<pagination>
<current-page>1</current-page>
<per-page>15</per-page>
<total-entries>2</total-entries>
<total-pages>1</total-pages>
</pagination>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-02-27T15:10:36Z</created-at>
<download>https://www.officedrop.com/ze/api/documents/1149/download</download>
<id>1149</id>
<name>pixily-test-11.pdf</name>
<page-count>1</page-count>
<status>DELETED</status>
<updated-at>2010-04-08T15:07:16Z</updated-at>
<view-count>0</view-count>
<folder>
<id>4</id>
<name>Default</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
<page-hits/>
</document>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-02-27T15:18:01Z</created-at>
<download>https://www.officedrop.com/ze/api/documents/1159/download</download>
<id>1159</id>
<name>OfficePad_Prioritized_Wishlist.pdf</name>
<page-count>1</page-count>
<status>DELETED</status>
<updated-at>2010-03-05T19:45:26Z</updated-at>
<view-count>1</view-count>
<labels>
<label>
<id>5</id>
<name>api testing</name>
</label>
</labels>
<folder>
<id>4</id>
<name>Default</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
<page-hits/>
</document>
</documents>
URL: https://{server_host}/ze/api/documents/purge.xml
Method: POST
Authentication required: Yes
Parameters:
This call will permanently delete the document from the OfficeDrop service, there is no way to undo this action, so please use this carefully.
Sample curl call:
curl -v -u "johnsmith:123456" -d “document_ids=1159,1160” https://www.officedrop.com/ze/api/documents/purge.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message> Documents were permanently deleted from our service</message>
<status>success</status>
</message>
URL: https://{server_host}/ze/api/documents/home.xml
Method: GET
Authentication required: Yes
Parameters:
When a document is uploaded and no folder is defined, this document goes to the user’s Home folder, that is a folder only that specific user can view. Only documents explicitly uploaded to public folders will be visible to other users.
Sample curl call:
curl -u "johnsmith:123456" https://www.officedrop.com/ze/api/documents/home.xml
Sample output:
<?xml version="1.0" encoding="UTF-8"?>
<documents>
<pagination>
<current-page>1</current-page>
<per-page>15</per-page>
<total-entries>1</total-entries>
<total-pages>1</total-pages>
</pagination>
<document>
<batch-type>UPLOAD</batch-type>
<cover>https://www.officedrop.com/ze/api/documents/1157/cover</cover>
<created-at>2010-02-27T15:17:20Z</created-at>
<download>https://www.officedrop.com/ze/api/documents/1157/download</download>
<id>1157</id>
<name>pixily-sample.pdf</name>
<original>https://www.officedrop.com/ze/api/documents/1157/original</original>
<page-count>1</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-04-12T20:10:25Z</updated-at>
<view-count>18</view-count>
<folder>
<id>37</id>
<name>Home</name>
<parent-folder>
<id>1</id>
<name>Root</name>
</parent-folder>
</folder>
<page-hits/>
<labels>
<label>
<id>5</id>
<name>api testing</name>
</label>
<label>
<id>3</id>
<name>Receipt</name>
</label>
<label>
<id>1</id>
<name>2007</name>
</label>
<label>
<id>4</id>
<name>Utility</name>
</label>
</labels>
</document>
</documents>
These calls will allow you to mark a document as a favorite for a user and also list all documents marked as favorites for that user.
URL: https://{server_host}/ze/api/document_favorites.xml
Method: POST
Parameters:
Sample curl call:
curl -u "johnsmith:123456" -d "id=1149" https://www.officedrop.com/ze/api/document_favorites.xml
Sample success response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>The document was successfully added to your favorites list</message>
<status>success</status>
</message>
URL: https://{server_host}/ze/api/document_favorites.xml
Method: GET
Parameters:
Sample curl call:
curl --basic -u "johnsmith:123456" https://www.officedrop.com/ze/api/document_favorites.xml
Sample success response:
<?xml version="1.0" encoding="UTF-8"?>
<documents>
<pagination>
<current-page>1</current-page>
<per-page>15</per-page>
<total-entries>1</total-entries>
<total-pages>1</total-pages>
</pagination>
<document>
<original>https://www.officedrop.com/ze/api/documents/1149/original</original>
<download>https://www.officedrop.com/ze/api/documents/1149/download</download>
<cover>https://www.officedrop.com/ze/api/documents/1157/cover</cover>
<batch-type>UPLOAD</batch-type>
<created-at>2010-02-27T15:10:36Z</created-at>
<download>1149.doc.pdf</download>
<id>1149</id>
<name>pixily-test-11.pdf</name>
<page-count>1</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-02-27T15:10:46Z</updated-at>
<view-count>0</view-count>
<folder>
<id>4</id>
<name>Default</name>
</folder>
</document>
</documents>
URL: https://{server_host}/ze/api/document_favorite
URL: https://{server_host}/ze/api/document_favorites/favorite.xml
Method: POST
Parameters:
Sample curl call:
curl -u "johnsmith:123456" -d "document_ids=1151,1153" https://www.officedro.com/ze/api/document_favorites/favorite.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>The documents were successfully added to your favorites list</message>
<status>success</status>
</message>
URL: https://{server_host}/ze/api/document_favorites/unfavorite.xml
Method: POST
Parameters:
Sample curl call:
curl -u "johnsmith:123456" -d "document_ids=1151,1153" https://www.officedrop.com/ze/api/document_favorites/unfavorite.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>The documents were successfully removed from your favorites list</message>
<status>success</status>
</message>
Purpose: The purpose of this call is to load and cache all documents that are already marked as favorites for the current user so the application can show a sign that a document is favorited without making a call for every document.
URL: https://{server_host}/ze/api/document_favorites/ids.xml
Method: GET
Sample CURL call:
curl -u "johnsmith:123456" https://www.officedrop.com/ze/api/document_favorites/ids.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<documents>
<document>
<id>1106</id>
</document>
<document>
<id>1104</id>
</document>
</documents>
Right when you upload a file to create a document at our service you don’t receive a document back, you receive a <batch/> object that will tell you at which state that specific file is. Before building the real document, OfficeDrop needs to convert it into a format we can extract text from it, we then index the extracted text, build a PDF version of the document and we finally sum up all these files to build the document representation you see at our website and at the API.
You could use the calls to the batch resource to let the user know at which state the document it just uploaded is and tell the user when the document itself is ready.
URL: https://{server_host}/ze/api/batches/[batch_id].xml
Method: GET
Sample curl request:
curl -v -u "johnsmith:123456" https://www.officedrop.com/ze/api/batches/1457445964.xml
Sample request:
<?xml version="1.0" encoding="UTF-8"?>
<batch>
<batch-status>READY_FOR_USER</batch-status>
<batch-type>UPLOAD</batch-type>
<content-type>application/pdf</content-type>
<download>20100227121000_3986558396.pdf</download>
<extract-type>text</extract-type>
<id>1457445964</id>
<name>pixily-test-11.pdf</name>
<size>19321</size>
<documents>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-02-27T15:10:36Z</created-at>
<download>1149.doc.pdf</download>
<id>1149</id>
<name>pixily-test-11.pdf</name>
<page-count>1</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-02-27T15:10:46Z</updated-at>
<view-count>0</view-count>
<folder>
<id>4</id>
<name>Default</name>
</folder>
</document>
</documents>
<folder>
<id>4</id>
<name>Default</name>
</folder>
<user>
<customer-name>John Smith</customer-name>
<email>johnsmith@mail.com</email>
<id>134156481</id>
<username>johnsmith</username>
</user>
</batch>
URL: https://{server_host}/ze/api/batches.xml
Method: GET
Parameters:
o started
o failed
o completed
Sample curl request:
curl -v -u "johnsmith:123456" https://www.officedrop.com/ze/api/batches.xml?status=completed
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<batches>
<pagination>
<current-page>1</current-page>
<per-page>15</per-page>
<total-entries>4</total-entries>
<total-pages>1</total-pages>
</pagination>
<batch>
<batch-status>READY_FOR_USER</batch-status>
<batch-type>UPLOAD</batch-type>
<content-type>application/pdf</content-type>
<download>20100227121155_711579835.pdf</download>
<extract-type>text</extract-type>
<id>1457445967</id>
<name>folder-to-notebook-link.pdf</name>
<size>181619</size>
<documents>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-02-27T15:17:01Z</created-at>
<download>1155.doc.pdf</download>
<id>1155</id>
<name>folder-to-notebook-link.pdf</name>
<page-count>2</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-02-27T15:17:48Z</updated-at>
<view-count>0</view-count>
<folder>
<id>4</id>
<name>Default</name>
</folder>
</document>
</documents>
<folder>
<id>4</id>
<name>Default</name>
</folder>
<user>
<customer-name>John Smith</customer-name>
<email>johnsmith@mail.com</email>
<id>15841</id>
<username>johnsmith</username>
</user>
</batch>
<batch>
<batch-status>READY_FOR_USER</batch-status>
<batch-type>UPLOAD</batch-type>
<content-type>application/pdf</content-type>
<download>20100227121303_2898649975.pdf</download>
<extract-type>text</extract-type>
<id>1457445970</id>
<name>pixily-sample.pdf</name>
<size>19321</size>
<documents>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-02-27T15:17:20Z</created-at>
<download>1157.doc.pdf</download>
<id>1157</id>
<name>pixily-sample.pdf</name>
<page-count>1</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-03-01T19:15:59Z</updated-at>
<view-count>1</view-count>
<folder>
<id>4</id>
<name>Default</name>
</folder>
</document>
</documents>
<folder>
<id>4</id>
<name>Default</name>
</folder>
<user>
<customer-name>John Smith</customer-name>
<email>johnsmith@mail.com</email>
<id>123181</id>
<username>johnsmith</username>
</user>
</batch>
<batch>
<batch-status>READY_FOR_USER</batch-status>
<batch-type>UPLOAD</batch-type>
<content-type>application/pdf</content-type>
<download>20100227121000_3986558396.pdf</download>
<extract-type>text</extract-type>
<id>1457445964</id>
<name>pixily-test-11.pdf</name>
<size>19321</size>
<documents>
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-02-27T15:10:36Z</created-at>
<download>1149.doc.pdf</download>
<id>1149</id>
<name>pixily-test-11.pdf</name>
<page-count>1</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-02-27T15:10:46Z</updated-at>
<view-count>0</view-count>
<folder>
<id>4</id>
<name>Default</name>
</folder>
</document>
</documents>
<folder>
<id>4</id>
<name>Default</name>
</folder>
<user>
<customer-name>John Smith</customer-name>
<email>johnsmith@mail.com</email>
<id>1518</id>
<username>johnsmith</username>
</user>
</batch>
</batches>
URL: https://{server_host}/ze/api/folders.xml
Method: GET
Action: List all folders from a user.
Sample curl request:
curl -v -u "johnsmith:123456" https://www.officedrop.com/ze/api/folders.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<folders>
<folder>
<folder-type>home</folder-type>
<id>2</id>
<name>Home</name>
</folder>
<folder>
<folder-type>regular</folder-type>
<id>5</id>
<name>google docs folder</name>
<child-folders>
<child-folder>
<folder-type>regular</folder-type>
<id>8</id>
<name>Internal folder</name>
</child-folder>
</child-folders>
</folder>
<folder>
<folder-type>regular</folder-type>
<id>31</id>
<name>main</name>
<child-folders>
<child-folder>
<folder-type>regular</folder-type>
<id>32</id>
<name>internal1</name>
<child-folders>
<child-folder>
<folder-type>regular</folder-type>
<id>33</id>
<name>internal2</name>
</child-folder>
</child-folders>
</child-folder>
</child-folders>
</folder>
</folders>
URL: https://{server_host}/ze/api/folders.xml
Method: POST
Action: Create folder.
Parameters:
Sample curl request:
curl -v -X POST -u “johnsmith:123456” -d "name=foldername&parent_id=2" https://www.officedrop.com/ze/api/folders.xml
Response: List all folders from a user updated.
URL: https://{server_host}/ze/api/folders/{folder id}.xml
Method: PUT
Action: Updating a folder (renaming it).
Sample curl request:
curl -v -X PUT -u “johnsmith:123456” -d "name=nice documents" https://www.officedrop.com/ze/api/folders/4.xml
Response: List all folders from a user updated.
URL: http://{server_host}/ze/api/folders/{folder id}.xml
Method: DELETE
Action: Delete a folder
Sample curl request:
curl -v -X DELETE -u “johnsmith:123456” https://www.officedrop.com/ze/api/folders/3.xml
Response: List all updated folders.
This call doesn’t really delete a folder and it’s contents, it just sends them all to the trash, you can view which folders are trashed at the trashed folders call.
URL: https://{server_host}/ze/api/folders/{folder id}/moveto.xml
Method: POST
Action: Move a document to folder
Parameters:
Sample curl request:
curl -v -X POST -d "document=333" -u “johnsmith:123456” https://www.officedrop.com/ze/api/folders/2/moveto.xml
Response: List all updated folders.
URL: https://{server_host}/ze/api/folders/{folder id}/moveto.xml
Method: POST
Action: Move a list of documents to folder
Parameters:
Sample curl request:
curl -v -X POST -d "documents[]=333&documents[]=4444" -u “johnsmith:123456” https://www.officedrop.com/ze/api/folders/2/moveto.xml
The request above will move the documents 333 and 4444 to folder id 2
Response: List all updated folders.
URL: https://{server_host}/ze/api/labels.xml
Method: GET
Action: List all labels.
Sample curl request:
curl -v -u “johnsmith:123456” https://www.officedrop.com/ze/api/labels.xml
XML Response
<?xml version="1.0" encoding="UTF-8"?>
<labels>
<label>
<id>8</id>
<name>Book</name>
</label>
<label>
<id>3</id>
<name>Receipt</name>
</label>
<label>
<id>4</id>
<name>Utility</name>
</label>
</labels>
URL: https://{server_host}/ze/api/labels.xml
Method: POST
Action: Create label.
Parameters:
Sample curl request:
curl -v -d "name=labelname" -u “johnsmith:123456” https://www.officedrop.com/ze/api/labels.xml
Response: List all labels.
URL: https://{server_host}/ze/api/labels/{label id}.xml
Method: PUT
Action: Update label (renaming).
Parameters:
Sample curl request:
curl -v -X PUT -d "name=labelname" -u “johnsmith:123456” https://www.officedrop.com/ze/api/labels/5.xml
Response: List all labels.
URL: https://{server_host}/ze/api/labels/{label id}.xml
Method: DELETE
Action: Delete label.
Sample curl request:
curl -v -X DELETE -u “johnsmith:123456” https://www.officedrop.com/ze/api/labels/5.xml
Response: List all labels.
URL: https://{server_host}/ze/api/labels/destroy_all.xml
Method: DELETE
Parameters:
Sample curl request:
curl -X DELETE -u "johnsmith:123456" -d "label_ids=1,2,5,4" https://www.officedrop.com/ze/api/labels/destroy_all.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>Labels successfully removed</message>
<status>success</status>
</message>
URL: https://{server_host}/ze/api/labels/apply.xml
Method: POST
Action: Apply labels for a set of documents
Parameters:
Sample curl request:
curl -v -u “johnsmith:123456” -d "documents[]=333&documents[]=4444&labels[]=777&labels[]=888" https://www.officedrop.com/ze/api/labels/apply.xml"
The labels 777 and 888 will be applied to documents 333 and 444
Response: List all labels.
URL: https://{server_host}/ze/api/labels/apply.xml
Method: POST
Action: Remove labels from a set of documents
Parameters:
Sample curl request:
curl -v -u “johnsmith:123456” -X DELETE -d "documents[]=333&documents[]=4444&labels[]=777&labels[]=888" https://www.officedrop.com/ze/api/labels/remove.xml"
The labels 777 and 888 will be removed from documents 333 and 444
Response: List all labels.
The artifacts are documents and its pages in a determined format, for example, page thumbnail, the original file, a PDF version of the original document. The calls below are requesting a brigde URL that will send the caller to a signed URL at S3. Refer for the OfficeDrop and Amazon S3 section at the beginning of the document for a full explanation on how bridge URLs work.
With this call you will receive the document in PDF format.
URL: https://{server_host}/ze/api/documents/{document id}/download
Sample curl request:
curl -v -u “johnsmith:123456” https://www.officedrop.com/ze/api/documents/1068/download
Response header looks like
HTTP/1.1 307
Date: Tue, 02 Mar 2010 12:29:19 GMT
Status: 307 Temporary Redirect
Location: https://s3.amazonaws.com/john-doe-bucket/users/111/documents/1068/dwnl_doc/1068.doc.pdf?AWSAccessKeyId=AKIAJYQQDPUWKJLGQUBA&Expires=1267534760&Signature=5cc6Aqr56Z1GZ16fYftYxg2gNjw%3D
With this call you will download the original document uploaded by the user.
URL: https://{server_host}/ze/api/documents/{document id}/original
Sample curl request:
curl -v -u “johnsmith:123456” https://www.officedrop.com/ze/api/documents/1068/original
Response header looks like
HTTP/1.1 307
Date: Tue, 02 Mar 2010 12:29:19 GMT
Status: 307 Temporary Redirect
Location: https://s3.amazonaws.com/john-doe-bucket/users/111/batches/1457445915/org/doc/20100301151824_596554821.pdf?AWSAccessKeyId=AKIAJYQQDPUWKJLGQUBA&Expires=1267534971&Signature=eANzJ6H9SqZQCWsLHd2HgLC1vp8%3D
When requesting a page using the “display” format, the width is always 720px, the height varies.
URL: https://{server_host}/ze/api/documents/{document id}/pages/{page number}/display
Sample curl request:
curl -v -u “johnsmith:123456” https://www.officedrop.com/ze/api/documents/1068/pages/4/display
Response header looks like
HTTP/1.1 307
Date: Tue, 02 Mar 2010 12:29:19 GMT
Status: 307 Temporary Redirect
When requesting a page using the “thumbnail” format, the width and heigh will always be 300x300px.
URL: https://{server_host}/ze/api/documents/{document id}/pages/{page number}/thumbnail
Sample curl request:
curl -v -u “johnsmith:123456” https://www.officedrop.com/ze/api/documents/1068/pages/4/thumbnail
Response header looks like
HTTP/1.1 307
Date: Tue, 02 Mar 2010 12:29:19 GMT
Status: 307 Temporary Redirect
Location: https://s3.amazonaws.com/john-doe-bucket/users/111/batches/1457445915/thumb/0004.d.jpeg?AWSAccessKeyId=AKIAJYQQDPUWKJLGQUBA&Expires=1267535517&Signature=uggG17aZzTHa0VEMOJo0Z3W2u3s%3D
When requesting a page using the “snippet_full” format, the width will always be 600px and the height will vary.
URL: https://{server_host}/ze/api/documents/{document id}/pages/{page number}/snippet_full
Sample curl request:
curl -v -u “johnsmith:123456” https://www.officedrop.com/ze/api/documents/1068/pages/4/snippet_full
Response header looks like
HTTP/1.1 307
Date: Tue, 02 Mar 2010 12:29:19 GMT
Status: 307 Temporary Redirect
Location: https://s3.amazonaws.com/john-doe-bucket/users/111/batches/1457445915/snp/0004.d.jpeg?AWSAccessKeyId=AKIAJYQQDPUWKJLGQUBA&Expires=1267535517&Signature=uggG17aZzTHa0VEMOJo0Z3W2u3s%3D
When calling a page with the “original” format, the dimensions will be in the page’s original size.
URL: https://{server_host}/ze/api/documents/{document id}/pages/{page number}/original
Sample curl request:
curl -v -u “johnsmith:123456” https://www.officedrop.com/ze/api/documents/1068/pages/4/original
Response header looks like
HTTP/1.1 307
Date: Tue, 02 Mar 2010 12:29:19 GMT
Status: 307 Temporary Redirect
Location: https://s3.amazonaws.com/pixily-test-data-dvlp-shairon/users/111/batches/1457445915/org/0004.png?AWSAccessKeyId=AKIAJYQQDPUWKJLGQUBA&Expires=1267535654&Signature=ZMcbGBWAntRw7nrHt0CJBNJoyMo%3D
Purpose: Share a resource with a collection of email addresses.
URL: https://{SERVER_HOST}/ze/api/shares.xml
Method: POST
Parameters:
Sample curl call:
curl -u "johnsmith:123456" --basic -d "share[visibility]=public&share[shared_id]=1161&share[shared_type]=Document&share[recipients]=someone@mail.com" https://www.officedrop.com/ze/api/shares.xml
Sample response:
<?xml version="1.0" encoding="UTF-8"?>
<message>
<code>200</code>
<message>The Document selected was successfully shared with the recipients provided</message>
<status>success</status>
</message>
When you share a document, with either a private or a public share, those shares are added to the given document, as in the example below:
<document>
<batch-type>UPLOAD</batch-type>
<created-at>2010-07-15T19:36:12Z</created-at>
<download>https://www.officedrop.com/ze/api/documents/1104/download</download>
<favorite>true</favorite>
<id>1104</id>
<name>pixily-test-02 (1).pdf</name>
<original>https://www.officedrop.com/ze/api/documents/1104/original</original>
<page-count>1</page-count>
<status>READY_FOR_USER</status>
<updated-at>2010-07-27T17:47:02Z</updated-at>
<view-count>1</view-count>
<folder>
<folder-type>home</folder-type>
<id>2</id>
<name>Items not in folder</name>
<folder>
<folder-type>regular</folder-type>
<id>1</id>
<name>Root</name>
</folder>
</folder>
<page-hits/>
<labels/>
<public-share>
<id>3</id>
<token>a6d17af1dc4de7956aa4ea1bd3988acaafaab805</token>
<url>https://www.officedrop.com/ze/guest/public/a6d17af1dc4de7956aa4ea1bd3988acaafaab805</url>
<viewed-count>0</viewed-count>
</public-share>
<private-shares>
<private-share>
<access-key>c667d53acd899a97a85de0c201ba99be</access-key>
<annotations-enabled>false</annotations-enabled>
<downloadable>false</downloadable>
<email>friend@mail.com</email>
<expire-at>2284-05-04T23:59:59Z</expire-at>
<id>1102</id>
<shared-at>2010-07-21T11:04:23Z</shared-at>
<status>ACTIVE</status>
<url>https://www.officedrop.com/ze/guest/access/c667d53acd899a97a85de0c201ba99be</url>
<viewed-count>0</viewed-count>
</private-share>
</private-shares>
<cover>
<snippet_full>https://www.officedrop.com/ze/api/documents/1104/pages/1/snippet_full</snippet_full>
<thumbnail>https://www.officedrop.com/ze/api/documents/1104/pages/1/thumbnail</thumbnail>
<display>https://www.officedrop.com/ze/api/documents/1104/pages/1/display</display>
</cover>
</document>
As with documents, when you share a folder, the sharing information becomes part of the folder markup:
<folder>
<folder-type>regular</folder-type>
<id>5</id>
<name>google docs folder</name>
<public-share>
<id>5</id>
<token>b106fe2ba60efcf7a0d026f12327db931dc25ff8</token>
<url>https://www.officedrop.com/ze/guest/public/b106fe2ba60efcf7a0d026f12327db931dc25ff8</url>
<viewed-count>0</viewed-count>
<widget-enabled>false</widget-enabled>
</public-share>
<private-shares>
<private-share>
<access-key>c9f95a0a5af052bffce5c89917335f67</access-key>
<annotations-enabled>false</annotations-enabled>
<downloadable>true</downloadable>
<email>another_friend@mail.com</email>
<expire-at>2010-08-11T23:59:59Z</expire-at>
<id>1106</id>
<shared-at>2010-07-28T15:12:59Z</shared-at>
<status>ACTIVE</status>
<url>https://www.officedrop.com/ze/guest/access/c9f95a0a5af052bffce5c89917335f67</url>
<viewed-count>0</viewed-count>
</private-share>
</private-shares>
</folder>