forked from dev-magdy/Shreyash-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththey-said-so-quotes.yaml
259 lines (259 loc) · 9.08 KB
/
they-said-so-quotes.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
openapi: 3.0.0
info:
termsOfService: https://theysaidso.com/terms#api
description: They Said So Quotes API offers a complete feature rich REST API access to its quotes platform.
title: They Said So Quotes API
version: "3.1"
contact:
name: They Said So
url: https://theysaidso.com/api/quote
servers:
- url: https://quotes.rest
tags:
- name: Quote of the day
description: Access quote of the day service. Use this to get the quote of the day in various categories. This is a free API that is available to public. You must credit They Said So if you are using the free version.
externalDocs:
description: Find out more
url: https://theysaidso.com/api/quote#qod
paths:
/qod:
get:
security:
- X-TheySaidSo-Api-Secret: []
tags:
- Quote of the day
description: |
Gets `Quote of the Day`. Optional `category` param determines the category of returned quote of the day
parameters:
- description: QOD Category
in: query
name: category
required: false
schema:
type: string
format: string
- description: Language of the QOD. The language must be supported in our QOD system.
in: query
name: language
required: false
schema:
type: string
format: string
default: "en"
responses:
"200":
description: 200 response
content:
application/json:
schema:
$ref: "#/components/schemas/QuoteResponse"
examples:
response:
value: >-
{
"success": {
"total": 1
},
"contents": {
"quotes": [
{
"quote": "Do not worry if you have built your castles in the air. They are where they should be. Now put the foundations under them.",
"length": "122",
"author": "Henry David Thoreau",
"tags": [
"dreams",
"inspire",
"worry"
],
"category": "inspire",
"date": "2016-11-21",
"title": "Inspiring Quote of the day",
"background": "https://theysaidso.com/img/bgs/man_on_the_mountain.jpg",
"id": "mYpH8syTM8rf8KFORoAJmQeF"
}
]
}
}
application/xml:
examples:
response:
value: >-
<?xml version="1.0"?>
<response>
<success>
<total>1</total>
</success>
<contents>
<quotes>
<quote>Sometimes you climb out of bed in the morning and you think, I'm not going to make it, but you laugh inside — remembering all the times you've felt that way.</quote>
<length>164</length>
<author>Charles Bukowski</author>
<tags>depression</tags>
<tags>inspire</tags>
<tags>tso-life</tags>
<category>inspire</category>
<date>2016-11-23</date>
<title>Inspiring Quote of the day</title>
<background>https://theysaidso.com/img/bgs/man_on_the_mountain.jpg</background>
<id>k7rTMtmveYHUN2ImwxNhhAeF</id>
</quotes>
</contents>
</response>
"400":
description: 400 response
content:
application/json:
examples:
response:
value: |-
{
"error": {
"code": 400,
"message": "Bad Request: QOD category not supported for this category and language combination"
}
}
/qod/categories:
get:
tags:
- Quote of the day
security:
- X-TheySaidSo-Api-Secret: []
description: |
Gets a list of `Quote of the Day` Categories.
parameters:
- description: Language of the QOD category. The language must be supported in our QOD system.
in: query
name: language
required: false
schema:
type: string
format: string
default: "en"
- description: Return detailed information of the categories. Note the data format changes between the two values of this switch.
in: query
name: detailed
required: false
schema:
type: boolean
format: boolean
default: false
responses:
"200":
description: 200 response
content:
application/json:
examples:
response:
value: |-
{
"success": {
"total": 8
},
"contents": {
"categories": {
"inspire": "Inspiring Quote of the day",
"management": "Management Quote of the day",
"sports": "Sports Quote of the day",
"life": "Quote of the day about life",
"funny": "Funny Quote of the day",
"love": "Quote of the day about Love",
"art": "Art quote of the day ",
"students": "Quote of the day for students"
},
"copyright": "2013-15 http://theysaidso.com"
}
}
"400":
description: 400 response
content:
application/json:
examples:
response:
value: |-
{
"error": {
"code": 400,
"message": "No QOD categories defined for this language."
}
}
/qod/languages:
get:
tags:
- Quote of the day
security:
- X-TheySaidSo-Api-Secret: []
description: |
Gets a list of supported languages for `Quote of the Day`.
responses:
"200":
description: 200 response
content:
application/json:
examples:
response:
value: |-
{
"success": {
"total": 2
},
"contents": {
"languages": [
"en",
"fr",
"ta"
]
},
"baseurl": "https://theysaidso.com",
"copyright": "2019-22 https://theysaidso.com"
}
components:
securitySchemes:
X-TheySaidSo-Api-Secret:
type: apiKey
name: X-TheySaidSo-Api-Secret
in: header
schemas:
QuoteResponse:
properties:
success:
description: Metadata about this successful call
type: string
contents:
properties:
quotes:
description: List of quotes
items:
$ref: "#/components/schemas/Quote"
type: array
Quote:
allOf:
- $ref: "#/components/schemas/NewQuote"
- required:
- id
properties:
id:
description: Unique identifier representing a specific quote in
theysaidso.com.
type: string
image:
description: Image URL that can be used for background to display this quote.
type: string
length:
description: Length of the quote string.
format: int32
type: integer
NewQuote:
properties:
author:
description: Author name of quote.
type: string
quote:
description: The Quote.
type: string
tags:
description: Array of tags/categories.
items:
type: string
type: array
required:
- quote