1919## Use in Visual Studio: https://learn.microsoft.com/en-us/aspnet/core/test/http-files ##
2020###############################################################################################
2121
22+ #############################################
23+ ### Resource Owner Password Flow
24+ # @name login
25+ POST {{baseUrl }}/api/_system/identity/connect/token
26+ Content-Type: application/x-www-form-urlencoded
27+
28+ grant_type=password
29+ & client_id = {{auth_client_id}}
30+ & username = {{auth_username}}
31+ & password = {{auth_password}}
32+ & scope = openid profile email roles
33+
2234###############################################################################################
2335### [GET] Customers - Find One ###
2436GET {{baseUrl }}/api/coremodule/customers/{{customerId}} HTTP/1.1
37+ Authorization: Bearer {{login.response.body.$.access_token}}
38+ Content-Type: application/json
2539
2640###############################################################################################
2741### [GET] Customers - Find All ###
2842GET {{baseUrl }}/api/coremodule/customers HTTP/1.1
43+ Authorization: Bearer {{login.response.body.$.access_token}}
44+ Content-Type: application/json
2945
3046###############################################################################################
3147### [GET] Customers - Find All filter ###
3248GET {{baseUrl }}/api/coremodule/customers?filter={"page":1,"pageSize":10,"filters":[{"field":"firstName","operator":"isnotnull"},{"field":"firstName","operator":"eq","value":"John"}]} HTTP/1.1
49+ Authorization: Bearer {{login.response.body.$.access_token}}
50+ Content-Type: application/json
3351
3452###############################################################################################
3553### [POST] Customers - Search All filter ###
3654POST {{baseUrl }}/api/coremodule/customers/search HTTP/1.1
55+ Authorization: Bearer {{login.response.body.$.access_token}}
3756Content-Type: application/json
3857
3958{
@@ -46,6 +65,7 @@ Content-Type: application/json
4665###############################################################################################
4766### [POST] Customers - Create ###
4867POST {{baseUrl }}/api/coremodule/customers HTTP/1.1
68+ Authorization: Bearer {{login.response.body.$.access_token}}
4969Content-Type: application/json
5070
5171{
@@ -58,6 +78,7 @@ Content-Type: application/json
5878###############################################################################################
5979### [PUT] Customers - Update ###
6080PUT {{baseUrl }}/api/coremodule/customers/{{customerId}} HTTP/1.1
81+ Authorization: Bearer {{login.response.body.$.access_token}}
6182Content-Type: application/json
6283
6384{
@@ -72,6 +93,7 @@ Content-Type: application/json
7293###############################################################################################
7394### [PUT] Customers - Change Status -> Active ###
7495PUT {{baseUrl }}/api/coremodule/customers/{{customerId}}/status HTTP/1.1
96+ Authorization: Bearer {{login.response.body.$.access_token}}
7597Content-Type: application/json
7698
7799{
@@ -82,14 +104,16 @@ Content-Type: application/json
82104### [DELETE] Customers - Delete (Created) ###
83105### (Idempotent test - expect 204 first time, 404 if repeated) ###
84106DELETE {{baseUrl }}/api/coremodule/customers/{{customerId}} HTTP/1.1
85-
107+ Authorization: Bearer {{login.response.body.$.access_token}}
108+ Content-Type: application/json
86109
87110
88111###############################################################################################
89112### [POST] Customers - Create ###
90113### [NEGATIVE] Customers - Invalid first/lastname (empty) ###
91114### (Should return 400) ###
92115POST {{baseUrl }}/api/coremodule/customers HTTP/1.1
116+ Authorization: Bearer {{login.response.body.$.access_token}}
93117Content-Type: application/json
94118
95119{
@@ -104,6 +128,7 @@ Content-Type: application/json
104128### [NEGATIVE] Customers - Update invalid concurrencyVersion (Random GUID) ###
105129### (Should return 409) ###
106130PUT {{baseUrl }}/api/coremodule/customers/{{customerId}} HTTP/1.1
131+ Authorization: Bearer {{login.response.body.$.access_token}}
107132Content-Type: application/json
108133
109134{
@@ -120,12 +145,15 @@ Content-Type: application/json
120145### [NEGATIVE] Customers - Get Not Found (Random GUID) ###
121146### (Should return 404) ###
122147GET {{baseUrl }}/api/coremodule/customers/00000000-0000-0000-0000-000000000001 HTTP/1.1
148+ Authorization: Bearer {{login.response.body.$.access_token}}
149+ Content-Type: application/json
123150
124151###############################################################################################
125152### [PUT] Customers - Update ###
126153### [NEGATIVE] Customers - Change invalid status ###
127154### (Should return 400) ###
128155PUT {{baseUrl }}/api/coremodule/customers/{{customerId}}/status HTTP/1.1
156+ Authorization: Bearer {{login.response.body.$.access_token}}
129157Content-Type: application/json
130158
131159{
@@ -137,9 +165,13 @@ Content-Type: application/json
137165### [NEGATIVE] Customers - Not Found (Random GUID) ###
138166### (Should return 404) ###
139167DELETE {{baseUrl }}/api/coremodule/customers/00000000-0000-0000-0000-000000000001 HTTP/1.1
168+ Authorization: Bearer {{login.response.body.$.access_token}}
169+ Content-Type: application/json
140170
141171###############################################################################################
142172### [DELETE] Customers - Delete ###
143173### [NEGATIVE] Customers - Not Found (Random GUID) ###
144174### (Should return 404) ###
145- DELETE {{baseUrl }}/api/coremodule/customers/exception HTTP/1.1
175+ DELETE {{baseUrl }}/api/coremodule/customers/exception HTTP/1.1
176+ Authorization: Bearer {{login.response.body.$.access_token}}
177+ Content-Type: application/json
0 commit comments