-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapiary.apib
167 lines (127 loc) · 4.69 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
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
FORMAT: 1A
HOST: https://muh.io/
# Muh
Muh api provides a in memory paste service, which immediately
stores your pastes. It is optimized on low latency access.
## Gist
A gist is just the logical layer on top of snippets.
It could also be called as a SnippetCollection.
## Gist/Snippet handling [/v1/gists]
Creating gists, adding snippets and requesting gists.
### Fetching a Gist [GET /v1/gists/{uuid}]
+ Parameters
+ uuid (string) - Gists unique identifier
+ Response 200 (application/json)
+ Attributes(Gist full)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Body
### Create a gist with snippets [POST /v1/gists]
+ Request (application/json)
+ Attributes(Snippet)
+ Body
{
"snippets": [
{ "paste": "some code", "lang": "ruby" }
{ "paste": "some code", "lang": "go" }
]
}
+ Response 201 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Attributes(Gist short)
+ Body
## User/Login handling [/v1/users]
### Get users profile [GET /v1/users/{uuid}/profile]
+ Parameters
+ uuid (string) - Users unique identifier
+ Response 200 (application/json)
+ Attributes(User)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Body
+ Response 404 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
### Create user [POST /v1/users]
+ Request (application/json)
+ Attributes(Login)
+ Request (application/x-www-form-urlencoded)
+ Attributes(Login)
+ Body
username=moo&
password=pass
+ Response 200 (application/json)
+ Attributes(User)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Body
+ Response 405 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Response 400 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
### Verify user/password combination [POST /v1/users/authorize]
+ Request (application/json)
+ Attributes(Login)
+ Request (application/x-www-form-urlencoded)
+ Attributes(Login)
+ Body
username=moo&
password=pass
+ Response 200 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Body
{ "user": {
"uuid": <uuid>
}
}
+ Response 403 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Response 400 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
### Reset users uuid [PUT /v1/users/{uuid}/uuid]
+ Parameters
+ uuid (string) - Users unique identifier
+ Response 200 (application/json)
+ Attributes(User)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
+ Body
+ Response 404 (application/json)
+ Headers
X-Ratelimit-Hits: Amount of requests until last reset
X-Ratelimit-Bytes: Amount of traffic (upload/download) until last reset
# Data Structures
## Login (object)
+ username: `moo` (string, required) - Username
+ password: `pass` (string, required) - Password
## User (object)
+ user:
+ uuid: `dab0759-3c0f-43d6-9177-2d718db61b3f` (string) - UserID
+ username: `moo` (string) - Username
## Gist short (object)
+ gist:
+ uuid: `2059d36c-cd5a-4271-8abd-cf184f04db7c` (string, required) - Unique gist identifier.
## Gist full (object)
+ gist:
+ uuid: `2059d36c-cd5a-4271-8abd-cf184f04db7c` (string, required) - Unique gist identifier.
+ snippets: (array[Snippet]) - A list of snippets
## Snippet (object)
+ paste: `some ruby code` (string, required) - Raw content of paste.
+ lang: `ruby` (string, required) - Which kind of programming language the paste is.