-
Notifications
You must be signed in to change notification settings - Fork 0
/
pandurangpatil.apib
173 lines (134 loc) · 3.92 KB
/
pandurangpatil.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
168
169
170
171
172
173
FORMAT: 1A
HOST: http://sample.pandurangpatil.com
# Sample API Documentation
Sample api documentation for sample project.
# Allowed HTTPs requests:
<pre>
PUT : To create resource
POST : Update resource
GET : Get a resource or list of resources
DELETE : To delete resource
</pre>
# Description Of Usual Server Responses:
- 200 `OK` - the request was successful (some API calls may return 201 instead).
- 201 `Created` - the request was successful and a resource was created.
- 204 `No Content` - the request was successful but there is no representation to return (i.e. the response is empty).
- 400 `Bad Request` - the request could not be understood or was missing required parameters.
- 401 `Unauthorized` - authentication failed or user doesn't have permissions for requested operation.
- 403 `Forbidden` - access denied.
- 404 `Not Found` - resource was not found.
- 405 `Method Not Allowed` - requested method is not supported for resource.
# Some sample
Test sample | test column two
First column sadf asdfads | sfsdsadf
---
test one | Another column
---
# Table sample
<table>
<tr>
<td> First Column </td>
<td> Second Column </td>
</tr>
<tr>
<td> First Column </td>
<td> Second Column </td>
</tr>
</table>
# Code Sample
<pre>
Some code here
</pre>
# Group User
Represents user details.
---
**User attributes:**
- id `(Number)` : unique identifier.
- fname `(String)` : First Name.
- lname `(String)` : Last Name.
- email `(String)` : email id of the user.
---
## User Collection [/users(?since,limit)]
### List all users [GET]
Retrieve paginated list of users.
+ Parameters
+ since (optional, String) ... Timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ` Only users updated at or after this time are returned.
+ limit (optional, Number) ... maximum number of records expected by client.
+ Response 200 (application/json)
[
{
"id": 1,
"fname": "Pandurang",
"lname": "Patil",
"email": "[email protected]"
},
{
"id": 2,
"fname": "Sangram",
"lname": "Shinde",
"email": "[email protected]"
}
]
+ Response 401 (application/json)
{
"error": "error.unauthorized"
}
### Create a User [PUT]
+ Request (application/json)
{
"fname": "Ram",
"lname": "Jadhav",
"email": "[email protected]"
}
+ Response 201 (application/json)
{
"id": 3,
"fname": "Ram",
"lname": "Jadhav",
"email": "[email protected]"
}
## User [/users/{id}]
A single User object with all its details
+ Parameters
+ id (required, Number, `1`) ... Numeric `id` of the User to perform action with.
### Retrieve a User [GET]
+ Response 200 (application/json)
+ Header
X-My-Header: The Value
+ Body
{
"id": 1,
"fname": "Pandurang",
"lname": "Patil",
"email": "[email protected]"
}
+ Response 401 (application/json)
{
"error": "error.unauthorized"
}
### Update a User [POST]
Update user details
+ Request (application/json)
{
"id": 1,
"fname": "Pandurang",
"lname": "Patil",
"email": "[email protected]"
}
+ Response 200 (application/json)
{
"id": 1,
"fname": "Pandurang",
"lname": "Patil",
"email": "[email protected]"
}
+ Response 401 (application/json)
{
"error": "error.unauthorized"
}
### Remove a User [DELETE]
+ Response 204
+ Response 401 (application/json)
{
"error": "error.unauthorized"
}