-
Notifications
You must be signed in to change notification settings - Fork 144
/
api.http
141 lines (117 loc) · 2.65 KB
/
api.http
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
# Local
@protocol = http
@hostname = localhost
@port = 5000
# Prod
# @protocol = https
# @hostname =
# @port = 443
@apiVersion = v1
@host = {{hostname}}:{{port}}
@baseUrl = {{protocol}}://{{host}}/api/{{apiVersion}}
@contentType = application/json
@accountCtrl = Account
@customerCtrl = Customer/customer-management
###
GET {{protocol}}://{{host}}/swagger
###
# @name register
# @prompt email
# @prompt pw
POST {{baseUrl}}/{{accountCtrl}}/register
Content-Type: {{contentType}}
{
"email": "{{email}}",
"password": "{{pw}}",
"confirmPassword": "{{pw}}"
}
###
# @name login
# @prompt email
# @prompt pw
POST {{baseUrl}}/{{accountCtrl}}/login
Content-Type: {{contentType}}
{
"email": "{{email}}",
"password": "{{pw}}",
"rememberMe": false
}
###
# @name refresh
# @prompt accessToken
# @prompt refreshToken
POST {{baseUrl}}/{{accountCtrl}}/refresh
Content-Type: {{contentType}}
{
"accessToken": "{{accessToken}}",
"refreshToken": "{{refreshToken}}",
}
###
@authToken = {{login.response.body.data.accessToken}}
# @name current
GET {{baseUrl}}/{{accountCtrl}}/current
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
###
# @name GetCustomers
GET {{baseUrl}}/{{customerCtrl}}
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
###
# @name CreateCustomer
# @prompt customerId
# @prompt customerName
# @prompt customerEmail
# @prompt customerBirthDate
POST {{baseUrl}}/{{customerCtrl}}
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"id": "{{customerId}}",
"name": "{{customerName}}",
"email": "{{customerEmail}}",
"birthDate": "{{customerBirthDate}}"
}
###
# @name UpdateCustomer
# @prompt customerId
# @prompt customerName
# @prompt customerEmail
# @prompt customerBirthDate
PUT {{baseUrl}}/{{customerCtrl}}
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
{
"id": "{{customerId}}",
"name": "{{customerName}}",
"email": "{{customerEmail}}",
"birthDate": "{{customerBirthDate}}"
}
###
# @name DeleteCustomer
# @prompt customerId
DELETE {{baseUrl}}/{{customerCtrl}}
?id={{customerId}}
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
###
# @name GetCustomer
# @prompt customerId
GET {{baseUrl}}/{{customerCtrl}}/{{customerId}}
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
###
# @name GetCustomerHistory
# @prompt customerId
GET {{baseUrl}}/{{customerCtrl}}/history/{{customerId}}
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}
###
# @name GetCustomerByPagination
# @prompt skip
# @prompt take
GET {{baseUrl}}/{{customerCtrl}}/pagination
?skip={{skip}}
&take={{take}}
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}