-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.API.postman_collection.json
More file actions
111 lines (111 loc) · 2.6 KB
/
Copy pathCustomer.API.postman_collection.json
File metadata and controls
111 lines (111 loc) · 2.6 KB
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
{
"info": {
"_postman_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Customer API",
"description": "API collection for Customer Event Sourcing microservice",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"variable": [
{
"key": "baseUrl",
"value": "http://localhost:5161",
"type": "string"
},
{
"key": "customerId",
"value": "",
"type": "string"
}
],
"item": [
{
"name": "Create Customer",
"event": [
{
"listen": "test",
"script": {
"exec": [
"if (pm.response.code === 200) {",
" var jsonData = pm.response.json();",
" pm.collectionVariables.set(\"customerId\", jsonData);",
" console.log(\"Customer ID saved: \" + jsonData);",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"phoneNumber\": \"+1234567890\",\n \"email\": \"john.doe@example.com\",\n \"address\": \"123 Main St, City, Country\",\n \"billingAddress\": \"123 Main St, City, Country\",\n \"dateOfBirth\": \"1990-01-15\"\n}"
},
"url": {
"raw": "{{baseUrl}}/customer",
"host": ["{{baseUrl}}"],
"path": ["customer"]
},
"description": "Create a new customer"
},
"response": []
},
{
"name": "Get Customer by ID",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/customer/{{customerId}}",
"host": ["{{baseUrl}}"],
"path": ["customer", "{{customerId}}"]
},
"description": "Get customer details by ID"
},
"response": []
},
{
"name": "Update Customer Email",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"john.updated@example.com\"\n}"
},
"url": {
"raw": "{{baseUrl}}/customer/{{customerId}}/email",
"host": ["{{baseUrl}}"],
"path": ["customer", "{{customerId}}", "email"]
},
"description": "Update customer email address"
},
"response": []
},
{
"name": "Delete Customer",
"request": {
"method": "DELETE",
"header": [],
"url": {
"raw": "{{baseUrl}}/customer/{{customerId}}",
"host": ["{{baseUrl}}"],
"path": ["customer", "{{customerId}}"]
},
"description": "Delete a customer by ID"
},
"response": []
}
]
}