/
apiary.apib
43 lines (32 loc) · 1.5 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FORMAT: 1A
HOST: https://carve-api.herokuapp.com
# carve-api
Carve API makes it easy to convert PDFs into an array PNGs.
The carve-api is based on [CONTRA]() API design. [JSON](http://www.json.org) is returned in all responses from the API, including errors.
I've tried to make it as easy to use as possible, but if you have any feedback please [let me know](mailto:mot@mot.la).
## GET /api/v0/documents/create.json?url={url}&webhook={webhook}
Create a document to generate PNGs. Allows for POST or GET.
+ Parameters
+ url (required, string, `http://mot.la/assets/resume.pdf`) ... String `url` of the PDF to convert.
+ webhook (required, string, `http://requestb.in/nxwuxynx`) ... String `webhook` where the converted PNGs payload will be deposited.
+ postscript (optional, string, `some_custom_string_value`) ... String `postscript` as a way to pass custom data as a string. Pass an ID or pass a stringified JSON payload. The choice is yours. Think of it as a postscript you write in a letter - it's not super necessary but it is useful at times.
+ Response 200 (application/json)
{
"documents": [{
"pages": [ ],
"status": "unprocessed",
"url": "http://mot.la/assets/resume.pdf",
"webhook": "http://requestb.in/nxwuxynx"
}],
"meta": {
"postscript": "some_custom_string_value"
}
}
+ Response 400 (application/json)
{
"errors": [{
"code": "required",
"field": "url",
"message": "url cannot be blank"
}]
}