What the API does
You send Draftable two documents. Draftable compares them and produces an interactive Side-by-Side comparison that your users open in a browser, showing exactly what changed between the two versions. Supported file types are PDF, Word (.doc, .docx, .docm), PowerPoint (.ppt, .pptx, .pptm), RTF and plain text. You can compare across formats, so a Word document can be compared against a PDF.How a comparison flows
Every integration follows the same four stages. Understanding this shape makes the rest of the API straightforward.1
Create the comparison
You send both documents to Draftable, either as direct uploads or as URLs Draftable fetches for you. Draftable responds immediately with a comparison identifier.
2
Draftable processes it
Comparison happens asynchronously. Larger documents take longer.
3
You wait for it to be ready
You either poll the comparison until it reports as ready, or hand the user a viewer URL that waits for you.
4
You present the result
You give the user a viewer URL. Optionally, you also export the comparison to PDF.
Creating a comparison is fast and always returns straight away. It does not block while the documents are compared. Any integration you build needs to account for the comparison not being ready the instant you create it.
Before you start
You need an account ID and an auth token. Both are available from your account at api.draftable.com/account/credentials. You will see two sets: one labelled test and one labelled production. Use the test credentials while you are building. They behave identically to production credentials but keep your development traffic separate. See Test and production accounts for the detail.Your first comparison
The API is available at:Authorization header.
Step 1: Create a comparison
The simplest way to start is with two documents Draftable can fetch by URL. Draftable hosts sample documents you can use for this."ready": false. The comparison exists, but Draftable is still working on it. Keep the identifier, as everything else you do refers to it.
Step 2: Check whether it is ready
ready becomes true and a ready_time appears. Check failed as well, because a comparison can finish unsuccessfully.
Step 3: View the result
Open the comparison in the viewer:wait parameter.

