forked from pawitp/ebook-convert-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
168 lines (168 loc) · 4.42 KB
/
swagger.yaml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
swagger: "2.0"
info:
description: "A REST API for Calibre's ebook-convert utility."
version: "1.0.0"
title: "ebook-convert API"
paths:
/version:
get:
summary: "Get version information"
produces:
- "application/json"
responses:
200:
description: "OK"
schema:
type: "object"
properties:
calibre:
type: "string"
description: "Output from ebook-convert --version"
example: "ebook-convert (calibre 2.75.1)"
/get/{filename}:
get:
summary: "Download specified file"
produces:
- "*/*"
parameters:
- in: path
name: filename
type: string
required: true
description: File to download
responses:
200:
description: "OK"
/upload:
post:
summary: "Upload file to temporary store"
consumes:
- "text/plain"
- "text/html"
- "application/epub+zip"
- "*/*"
produces:
- "application/json"
parameters:
- in: body
name: document
required: true
schema:
type: string
example: "Example document"
responses:
200:
description: "OK"
schema:
$ref: "#/definitions/SaveResponse"
security:
- api_key: []
/fetch:
post:
summary: "Fetch file from remote server to temporary store"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: body
name: request
schema:
type: "object"
properties:
url:
type: "string"
description: "URL to fetch"
example: "http://example.com"
headers:
type: "object"
description: "HTTP Headers to send"
save:
type: "boolean"
description: "Whether to save the output or return it in the response"
default: false
responses:
200:
description: "OK"
schema:
$ref: "#/definitions/SaveResponse"
security:
- api_key: []
/convert:
post:
summary: "Trigger conversion of document"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: body
name: request
schema:
type: "object"
properties:
source:
type: "string"
description: "Filename of conversion to input"
example: "1168baaa-c75e-436e-934c-1888e92a49d9.txt"
format:
type: "string"
description: "Target format (e.g. azw3 or epub)"
example: "azw3"
responses:
200:
description: "OK"
schema:
type: "object"
properties:
href:
type: "string"
description: "Filename of conversion output"
example: "ff4002db-a078-41a2-acdd-f5c8929c9a29.azw3"
output:
type: "string"
description: "Output from ebook-convert utility"
example: ""
security:
- api_key: []
/email:
post:
summary: "Send document to email address"
consumes:
- "application/json"
parameters:
- in: body
name: request
schema:
type: "object"
properties:
source:
type: "string"
description: "Filename of document to send"
example: "1168baaa-c75e-436e-934c-1888e92a49d9.txt"
to:
type: "string"
description: "Email address of recipient"
example: "[email protected]"
subject:
type: "string"
description: "Subject for email"
example: "convert"
responses:
204:
description: "OK"
security:
- api_key: []
securityDefinitions:
api_key:
type: "apiKey"
name: "x-api-key"
in: "header"
definitions:
SaveResponse:
type: "object"
properties:
href:
type: "string"
description: "Filename of saved object"
example: "1168baaa-c75e-436e-934c-1888e92a49d9.txt"