-
-
Save jqr/006215da666f9fde0eaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This example will create a sample asynchronous pdf document with the authentication information as part of the POST data | |
curl http://docraptor.com/docs \ | |
--fail --silent --show-error \ | |
--header "Content-Type: application/json" \ | |
--data '{ | |
"user_credentials": "YOUR_API_KEY_HERE", | |
"doc": { | |
"name": "async_example.pdf", | |
"document_type":"pdf", | |
"async":"true", | |
"test":"true", | |
"document_url":"https://docraptor.com/examples/invoice.html" | |
}}' > async_response.json | |
# Making an asynchronous request will return some JSON with a status_id key like '{"status_id":"123454321"}' | |
cat async_response.json | |
# You can then use the status_id key to check the status of your asynchronous job | |
curl http://docraptor.com/status/bd8d083038970133a11022000b2b8d5d \ | |
--fail --silent --show-error \ | |
--header "Content-Type: application/json" \ | |
--data '{ | |
"user_credentials": "YOUR_API_KEY_HERE"}' | |
# Once your job has completed, you will recieve a response that contains the download_url for your document | |
{ | |
"status": "completed", | |
"download_url": "http://docraptor.com/download/1a2b3c4d5e6f7g8h9i112233aabbccdd", | |
"number_of_pages": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment