-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrud_api.postman_collection.json
211 lines (211 loc) · 8.44 KB
/
crud_api.postman_collection.json
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
{
"info": {
"_postman_id": "65586818-b71e-46a9-abfb-1847cd0390c5",
"name": "RSS Node.js Crud API",
"description": "This template contains a boilerplate for documentation that you can quickly customize and reuse.\n\n### How to use this template:\n\n- Replace the content given brackets (()) with your API's details.\n- Tips are formatted in `codespan` - feel free to read and remove them.\n \n\n---\n\n`Start with a brief overview of what your API offers.`\n\nThe ((product name)) provides many API products, tools, and resources that enable you to ((add product value here)).\n\n`You can also list the APIs you offer, link to the relevant pages, or do both in this section.`\n\n## **Getting started guide**\n\n`List the steps or points required to start using your APIs. Make sure to cover everything required to reach success with your API as quickly as possible.`\n\nTo start using the ((add APIs here)), you need to -\n\n`The points given below are from The Postman API's documentation. You can reference it to write your own getting started guide.`\n\n- You must use a valid API Key to send requests to the API endpoints. You can get your API key from Postman's [integrations dashboard](https://go.postman.co/settings/me/api-keys).\n- The API has [rate and usage limits](https://postman.postman.co/workspace/Collection-Templates~6311738d-2e70-441f-ae12-78caf078c5b7/collection/22517504-e9c28f47-1253-44af-a2f3-20dce4da1f18?ctx=documentation#rate-and-usage-limits).\n- The API only responds to HTTPS-secured communications. Any requests sent via HTTP return an HTTP 301 redirect to the corresponding HTTPS resources.\n- The API returns request responses in JSON format. When an API request returns an error, it is sent in the JSON response as an error key.\n \n\n## Authentication\n\n`Add details on the authorization keys/tokens required, steps that cover how to get them, and the relevant error codes.`\n\nThe ((product name)) API uses ((add your API's authorization type)) for authentication.\n\n`The details given below are from the Postman API's documentation. You can reference it to write your own authentication section.`\n\nPostman uses API keys for authentication. You can generate a Postman API key in the [API keys](https://postman.postman.co/settings/me/api-keys) section of your Postman account settings.\n\nYou must include an API key in each request to the Postman API with the X-Api-Key request header.\n\n### Authentication error response\n\nIf an API key is missing, malformed, or invalid, you will receive an HTTP 401 Unauthorized response code.\n\n## Rate and usage limits\n\n`Use this section to cover your APIs' terms of use. Include API limits, constraints, and relevant error codes, so consumers understand the permitted API usage and practices.`\n\n`The example given below is from The Postman API's documentation. Use it as a reference to write your APIs' terms of use.`\n\nAPI access rate limits apply at a per-API key basis in unit time. The limit is 300 requests per minute. Also, depending on your plan, you may have usage limits. If you exceed either limit, your request will return an HTTP 429 Too Many Requests status code.\n\nEach API response returns the following set of headers to help you identify your use status:\n\n| Header | Description |\n| --- | --- |\n| `X-RateLimit-Limit` | The maximum number of requests that the consumer is permitted to make per minute. |\n| `X-RateLimit-Remaining` | The number of requests remaining in the current rate limit window. |\n| `X-RateLimit-Reset` | The time at which the current rate limit window resets in UTC epoch seconds. |\n\n### 503 response\n\nAn HTTP `503` response from our servers indicates there is an unexpected spike in API access traffic. The server is usually operational within the next five minutes. If the outage persists or you receive any other form of an HTTP `5XX` error, [contact support](https://support.postman.com/hc/en-us/requests/new/).\n\n### **Need some help?**\n\n`Add links that customers can refer to whenever they need help.`\n\nIn case you have questions, go through our tutorials ((link to your video or help documentation here)). Or visit our FAQ page ((link to the relevant page)).\n\nOr you can check out our community forum, there’s a good chance our community has an answer for you. Visit our developer forum ((link to developer forum)) to review topics, ask questions, and learn from others.\n\n`You can also document or add links to libraries, code examples, and other resources needed to make a request.`",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "28968368"
},
"item": [
{
"name": "User",
"item": [
{
"name": "Get Users",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{BASE_URL}}:{{PORT}}/{{USERS_ROUTE}}",
"host": [
"{{BASE_URL}}"
],
"port": "{{PORT}}",
"path": [
"{{USERS_ROUTE}}"
]
}
},
"response": []
},
{
"name": "Get User",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{BASE_URL}}:{{PORT}}/{{USERS_ROUTE}}/{{USER_ID}}",
"host": [
"{{BASE_URL}}"
],
"port": "{{PORT}}",
"path": [
"{{USERS_ROUTE}}",
"{{USER_ID}}"
]
}
},
"response": []
},
{
"name": "Create User",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();\r",
"pm.environment.set(\"USER_ID\", response.data.user.id);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"id\": \"e8e06aa1-cba7-5af0-be15-703774ccfb3b\",\r\n \"age\": 1,\r\n \"username\": \"test\",\r\n \"hobbies\": [\r\n \"test\"\r\n ]\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BASE_URL}}:{{PORT}}/{{USERS_ROUTE}}",
"host": [
"{{BASE_URL}}"
],
"port": "{{PORT}}",
"path": [
"{{USERS_ROUTE}}"
]
}
},
"response": []
},
{
"name": "Update User",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"id\": \"0aa5d95a-f25e-411a-8086-fb55d3fc9d67\",\r\n \"age\": 12,\r\n \"username\": \"changed username\",\r\n \"hobbies\": [\r\n \"the hobbies changed\"\r\n ]\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BASE_URL}}:{{PORT}}/{{USERS_ROUTE}}/ec7db8fe-f18a-4053-be75-6f9e507eb638",
"host": [
"{{BASE_URL}}"
],
"port": "{{PORT}}",
"path": [
"{{USERS_ROUTE}}",
"ec7db8fe-f18a-4053-be75-6f9e507eb638"
]
}
},
"response": []
},
{
"name": "Delete User",
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "{{BASE_URL}}:{{PORT}}/{{USERS_ROUTE}}/{{USER_ID}}",
"host": [
"{{BASE_URL}}"
],
"port": "{{PORT}}",
"path": [
"{{USERS_ROUTE}}",
"{{USER_ID}}"
]
}
},
"response": []
}
],
"description": "The `/me` endpoints let you manage information about the authenticated user."
},
{
"name": "Not Found",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{BASE_URL}}:{{PORT}}/api/some-non/existing/resource",
"host": [
"{{BASE_URL}}"
],
"port": "{{PORT}}",
"path": [
"api",
"some-non",
"existing",
"resource"
]
}
},
"response": []
}
],
"auth": {
"type": "apikey",
"apikey": [
{
"key": "key",
"value": "X-API-Key",
"type": "string"
},
{
"key": "value",
"value": "{{token}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "baseUrl",
"value": "https://farming-simulator.pstmn.io"
}
]
}