-
Notifications
You must be signed in to change notification settings - Fork 5
/
cleanuri.yaml
57 lines (53 loc) · 1.96 KB
/
cleanuri.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
openapi: 3.0.3
info:
title: cleanuri.com API
version: 1.0.0
description:
cleanuri.com exposes its data via an Application Programming Interface (API), so developers can interact in a programmatic way with application.
Notes -
1. Long URLs should be URL-encoded. You can not include a longUrl in the request that has &, ?, \#, or other reserved parameters without first encoding it.
2. Long URLs should not contain spaces- any longUrl with spaces will be rejected. All spaces should be either percent encoded %20 or plus encoded +. Note that tabs, newlines and trailing spaces are all indications of errors. Please remember to strip leading and trailing whitespace from any user input before shortening.
servers:
- url: https://cleanuri.com
paths:
/api/v1/shorten:
post:
summary: Shorten a long URL
description: Given a long URL, returns a short link.
requestBody:
content:
application/json:
schema:
type: object
properties:
url:
type: string
format: uri
required:
- url
required: true
responses:
"200":
description: Successful response with short URL
content:
application/json:
schema:
type: object
properties:
result_url:
type: string
format: uri
description: Shortened URL
error:
type: string
description: Information about the error, if it occurred
"400":
description: Bad request, missing or invalid parameters
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Information about the error