-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
605 lines (605 loc) · 23.7 KB
/
openapi.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
openapi: 3.0.0
info:
title: 'URLR API Reference'
description: "API powering the features of URLR.<br><br>Note that in order to facilitate integration, we provide SDKs for various languages at https://github.com/URLR.<br><br>Key API principles:<br>\n <ul><li>All dates follow **ISO-8601** format</li><li>Most errors follow **RFC 9457** standard</li><li>All responses are delivered in English</li></ul>"
termsOfService: 'https://urlr.me/en/terms-of-use'
contact:
name: URLR
url: 'https://urlr.me/en'
email: [email protected]
license:
name: 'All rights reserved'
url: 'https://urlr.me/en/legal-notice'
version: '1.4'
servers:
-
url: 'https://urlr.me/api/v1'
description: 'Main API entry point'
paths:
/access_tokens/create:
post:
tags:
- 'Access Tokens'
summary: 'Get an access token'
operationId: createAccessToken
requestBody:
description: 'You can use this endpoint to get an access token to access the API.'
content:
application/json:
schema:
required:
- username
- password
properties:
username:
description: Email
type: string
password:
description: Password
type: string
type: object
responses:
'200':
description: 'Access token'
content:
application/json:
schema:
properties:
token: { description: 'Access token (JWT) valid for 1 hour', type: string }
refresh_token: { description: 'Refresh token valid for 1 month', type: string }
type: object
'401':
description: Error
content:
application/json:
schema:
properties:
code: { type: integer, example: 401 }
message: { type: string, example: 'Invalid credentials.' }
type: object
/access_tokens/refresh:
post:
tags:
- 'Access Tokens'
summary: 'Refresh an access token'
operationId: refreshAccessToken
requestBody:
description: 'You can use this endpoint to refresh your access token without credentials.'
content:
application/json:
schema:
required:
- refresh_token
properties:
refresh_token:
description: 'Refresh token'
type: string
type: object
responses:
'200':
description: 'Refreshed access token'
content:
application/json:
schema:
properties:
token: { description: 'Access token (JWT) valid for 1 hour', type: string }
refresh_token: { description: 'Refresh token valid for 1 month', type: string }
type: object
'401':
description: Error
content:
application/json:
schema:
properties:
code: { type: integer, example: 401 }
message: { type: string, example: 'Missing JWT Refresh Token' }
type: object
'/links/{link_id}':
get:
tags:
- Links
summary: 'Get a link'
operationId: getLink
parameters:
-
name: link_id
in: path
description: 'Link API ID'
required: true
schema:
type: string
format: uuid
example: ffefc6c4-d970-4373-a867-2a69c8be2c89
responses:
'200':
description: Link
content:
application/json:
schema:
properties:
id: { description: 'Link API ID', type: string, format: uuid, example: 436b5d20-e174-4363-94e5-2b3dd4e74b5f }
url: { description: 'Original URL', type: string }
team_id: { description: 'Team API ID', type: string, format: uuid }
folder_id: { description: 'Folder API ID', type: string, format: uuid }
domain: { description: Domain, type: string, format: hostname, example: urlr.me }
code: { description: 'Short code', type: string, example: xxxxx }
label: { description: Label, type: string }
qrcode: { description: 'QR Code associated to the short link', properties: { data: { description: 'QR Code Data URL', type: string } }, type: object }
utm: { description: 'UTM parameters', properties: { campaign: { description: utm_campaign, type: string, maxLength: 255 }, medium: { description: utm_medium, type: string, maxLength: 255 }, source: { description: utm_source, type: string, maxLength: 255 }, content: { description: utm_content, type: string, maxLength: 255 } }, type: object }
metatag: { description: 'Custom metadata for social previews', properties: { title: { description: 'Title of the link', type: string, maxLength: 255 }, description: { description: 'Description of the link', type: string, maxLength: 255 }, image: { description: 'Image URL of the link', type: string, format: url } }, type: object }
geolinks: { description: 'Geographical targeting links', type: array, items: { properties: { type: { description: 'Type of the geographic link', type: string }, value: { description: 'Value corresponding to the type of the geographic link', type: string }, url: { description: 'URL of the geographic link', type: string, format: url } }, type: object } }
created_at: { description: 'Creation date', type: string, format: date-time }
updated_at: { description: 'Modification date', type: string, format: date-time }
expired_at: { description: 'Expiration date', type: string, format: date-time }
expired_url: { description: 'Expiration URL', type: string, format: url }
type: object
'404':
description: 'Not Found'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 404 }
detail: { type: string }
type: object
'401':
description: Unauthorized
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 401 }
detail: { type: string }
type: object
'422':
description: 'Validation Failed'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 422 }
detail: { type: string }
type: object
security:
-
bearerAuth: []
/links/create:
post:
tags:
- Links
summary: 'Create a link'
operationId: createLink
requestBody:
description: 'Info of the link to create'
content:
application/json:
schema:
required:
- url
- team_id
properties:
url:
description: 'URL to shorten'
type: string
team_id:
description: 'Team API ID'
type: string
format: uuid
folder_id:
description: 'Folder API ID'
type: string
format: uuid
domain:
description: Domain
type: string
format: hostname
example: mybrand.com
code:
description: 'Custom short code'
type: string
pattern: '^[a-zA-Z0-9!-]{2,50}$'
example: xxxxx
label:
description: Label
type: string
password:
description: Password
type: string
qrcode:
description: 'QR Code'
properties: { size: { description: 'The size of the QR code (px)', type: integer, default: 600, maximum: 1000, minimum: 100 }, format: { description: 'The format of the QR code', type: string, default: png, enum: [png, webp, svg] }, margin: { description: 'The margin around the QR code (px)', type: integer, default: 0 }, background_color: { description: 'The background color of the QR code (hexadecimal)', type: string, default: '#ffffff' }, foreground_color: { description: 'The foreground color of the QR code (hexadecimal)', type: string, default: '#000000' } }
type: object
utm:
description: 'UTM parameters'
properties: { campaign: { description: utm_campaign, type: string, maxLength: 255 }, medium: { description: utm_medium, type: string, maxLength: 255 }, source: { description: utm_source, type: string, maxLength: 255 }, content: { description: utm_content, type: string, maxLength: 255 } }
type: object
metatag:
description: 'Custom metadata for social previews'
properties: { title: { description: 'Title for the link', type: string, maxLength: 255 }, description: { description: 'Description for the link', type: string, maxLength: 255 }, image: { description: 'Image URL for the link. Recommended: 1200X630px<br>Maximum size: 3Mb - Formats: PNG, JPEG, WebP and GIF.', type: string, format: url } }
type: object
expired_at:
description: 'Expiration date'
type: string
format: date-time
expired_url:
description: 'Expiration URL'
type: string
format: url
type: object
responses:
'201':
description: Link
content:
application/json:
schema:
properties:
id: { description: 'Link API ID', type: string, format: uuid, example: 436b5d20-e174-4363-94e5-2b3dd4e74b5f }
url: { description: 'Original URL', type: string }
team_id: { description: 'Team API ID', type: string, format: uuid }
folder_id: { description: 'Folder API ID', type: string, format: uuid }
domain: { description: Domain, type: string, format: hostname, example: urlr.me }
code: { description: 'Short code', type: string, example: xxxxx }
label: { description: Label, type: string }
qrcode: { description: 'QR Code associated to the short link', properties: { data: { description: 'QR Code Data URL', type: string } }, type: object }
utm: { description: 'UTM parameters', properties: { campaign: { description: utm_campaign, type: string, maxLength: 255 }, medium: { description: utm_medium, type: string, maxLength: 255 }, source: { description: utm_source, type: string, maxLength: 255 }, content: { description: utm_content, type: string, maxLength: 255 } }, type: object }
metatag: { description: 'Custom metadata for social previews', properties: { title: { description: 'Title of the link', type: string, maxLength: 255 }, description: { description: 'Description of the link', type: string, maxLength: 255 }, image: { description: 'Image URL of the link', type: string, format: url } }, type: object }
geolinks: { description: 'Geographical targeting links', type: array, items: { properties: { type: { description: 'Type of the geographic link', type: string }, value: { description: 'Value corresponding to the type of the geographic link', type: string }, url: { description: 'URL of the geographic link', type: string, format: url } }, type: object } }
created_at: { description: 'Creation date', type: string, format: date-time }
updated_at: { description: 'Modification date', type: string, format: date-time }
expired_at: { description: 'Expiration date', type: string, format: date-time }
expired_url: { description: 'Expiration URL', type: string, format: url }
type: object
'401':
description: Unauthorized
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 401 }
detail: { type: string }
type: object
'422':
description: 'Validation Failed'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 422 }
detail: { type: string }
type: object
'429':
description: 'Limits Exceeded'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 429 }
detail: { type: string }
type: object
'500':
description: 'Internal Error'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 500 }
detail: { type: string }
type: object
security:
-
bearerAuth: []
/qrcodes/create:
post:
tags:
- 'QR Codes'
summary: 'Create a QR Code'
operationId: createQrCode
requestBody:
description: 'Info of the QR Code to create'
content:
application/json:
schema:
properties:
size:
description: 'The size of the QR code (px)'
type: integer
default: 600
maximum: 1000
minimum: 100
format:
description: 'The format of the QR code'
type: string
default: png
enum: [png, webp, svg]
margin:
description: 'The margin around the QR code (px)'
type: integer
default: 0
background_color:
description: 'The background color of the QR code (hexadecimal)'
type: string
default: '#ffffff'
foreground_color:
description: 'The foreground color of the QR code (hexadecimal)'
type: string
default: '#000000'
type: object
oneOf:
-
required: [url, team_id]
properties: { url: { description: 'URL of the QR Code', type: string, format: url }, team_id: { description: 'Team API ID', type: string, format: uuid } }
type: object
-
required: [link_id]
properties: { link_id: { description: 'Link API ID of the QR Code', type: string, format: uuid } }
type: object
responses:
'201':
description: 'QR Code'
content:
image/png:
schema:
type: string
format: binary
image/webp:
schema:
type: string
format: binary
image/svg+xml:
schema:
type: string
format: binary
'401':
description: Unauthorized
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 401 }
detail: { type: string }
type: object
'422':
description: 'Validation Failed'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 422 }
detail: { type: string }
type: object
'429':
description: 'Limits Exceeded'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 429 }
detail: { type: string }
type: object
'500':
description: 'Internal Error'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 500 }
detail: { type: string }
type: object
security:
-
bearerAuth: []
/statistics:
post:
tags:
- Statistics
summary: 'Get statistics of a link'
operationId: getStatistics
requestBody:
description: 'Infos to provide to get statistics of a link'
content:
application/json:
schema:
required:
- link_id
properties:
link_id:
description: 'Link API ID'
type: string
format: uuid
from:
description: 'Get statistics from this date'
type: string
format: date-time
to:
description: 'Get statistics until this date'
type: string
format: date-time
include_bots:
description: 'Whether include bots or not in statistics'
type: boolean
default: false
type: object
responses:
'200':
description: 'Statistics of the link'
content:
application/json:
schema:
properties:
link_id: { description: 'Link API ID', type: string, format: uuid }
clicks: { description: Clicks, type: integer, example: 32 }
unique_clicks: { description: 'Unique clicks', type: integer, example: 51 }
type: object
'404':
description: 'Not Found'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 404 }
detail: { type: string }
type: object
'401':
description: Unauthorized
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 401 }
detail: { type: string }
type: object
'422':
description: 'Validation Failed'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 422 }
detail: { type: string }
type: object
security:
-
bearerAuth: []
/teams:
get:
tags:
- Teams
summary: 'Get teams of user'
operationId: getTeams
responses:
'200':
description: 'Teams of user'
content:
application/json:
schema:
properties:
teams: { type: array, items: { properties: { id: { description: 'Team API ID', type: string, format: uuid, example: ffefc6c4-d970-4373-a867-2a69c8be2c89 }, name: { description: 'Team name', type: string, example: 'the best team' } }, type: object } }
type: object
'401':
description: Unauthorized
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 401 }
detail: { type: string }
type: object
security:
-
bearerAuth: []
'/folders/{team_id}':
get:
tags:
- Folders
summary: 'Get folders of team'
operationId: getFolders
parameters:
-
name: team_id
in: path
description: 'Team API ID'
required: true
schema:
type: string
format: uuid
example: ffefc6c4-d970-4373-a867-2a69c8be2c89
responses:
'200':
description: 'Folders of team'
content:
application/json:
schema:
properties:
folders: { type: array, items: { properties: { id: { description: 'Folder API ID', type: string, format: uuid, example: 436b5d20-e174-4363-94e5-2b3dd4e74b5f }, name: { description: 'Folder name', type: string, example: folder-campaign-google-ads } }, type: object } }
type: object
'404':
description: 'Not Found'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 404 }
detail: { type: string }
type: object
'401':
description: Unauthorized
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 401 }
detail: { type: string }
type: object
'422':
description: 'Validation Failed'
content:
application/problem+json:
schema:
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 422 }
detail: { type: string }
type: object
security:
-
bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
bearerFormat: JWT
scheme: bearer
tags:
-
name: 'Access Tokens'
description: 'Access Tokens'
-
name: Links
description: Links
-
name: 'QR Codes'
description: 'QR Codes'
-
name: Statistics
description: Statistics
-
name: Teams
description: Teams
-
name: Folders
description: Folders