-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathapi_sample.txt
179 lines (150 loc) · 3.41 KB
/
api_sample.txt
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
#====================================
# Authnetication APIs
#====================================
# Login
POST /api/v1/auth/login
{
"username": "roshan",
"password": "roshan"
}
API Response Body - Failed authetnication
{
"response": "failed",
"reason": "Password did not match",
"data": null
}
API Response Body - Successful authentication
{
"response": "success",
"reason": "Authentication completed",
"data": {
"token": "YmMek0j8PVDG70EB8zJ0ZlhE1Z08gNd0EcytrMHz8vI=",
"username": "roshan"
}
}
## Logout
POST /api/v1/auth/logout
{
"username": "roshan3"
}
Logut Response Body
{
"response": "success",
"reason": "Logout completed",
"data": {
"clientip": "127.0.0.1",
"token": "h7Wx6o89D95HNmtm0v951_HmL4H8YYxhb20CAPrQgrU=",
"username": "roshan3"
}
}
# Change Password
POST /api/v1/auth/password/change
{
"password": "roshan",
"new_password": "roshan123"
}
Change Password response body
{
"response": "success",
"reason": "Password change completed",
"data": "roshan3"
}
# PasswordSet
POST /api/v1/admin/password/set
{
"username": "roshan",
"new_password": "roshan123"
}
Password set response body
{
"response": "success",
"reason": "Password set completed",
"data": "roshan"
}
#====================================
# TAG APIs
#====================================
# Adding New Tag
POST /api/v1/tag/add/{casename}/{endpoint}/{audit}/{doc_id}
{
"created_by": "roshan",
"tag_name": "tag_1"
}
API Response Body
{
"response": "success",
"reason": "Tag added successfully",
"data": "AWDxFO0eQ7ZZOJuRMFd4"
}
# GetTagData for Audit entry
GET /api/v1/tag/show/{casename}/{endpoint}/{audit}/{doc_id}
API Response Body - Success
{
"response": "success",
"reason": "Tag search completed",
"data": [
{
"timestamp": "2018-01-13T07:25:50Z",
"created_by": "roshan",
"casename": "CASE-ALFA-01",
"computername": "COMPUTER-01",
"audit": "w32services",
"doc_id": "AWDs7OD5Q7ZZOJuRMFdq",
"tag_category": "result",
"tag_name": "testtag"
}
]
}
API Response Body - Failed
{
"response": "failed",
"reason": "No result found",
"data": null
}
#====================================
# Comment APIs
#====================================
# Adding New Comment
POST /api/v1/comment/add/{casename}/{endpoint}/{audit}/{doc_id}
{
"created_by": "roshan",
"comment": "This is a test comment"
}
API Response Body
{
"response": "success",
"reason": "Comment added",
"data": "AWDxPKSiQ7ZZOJuRMFd7"
}
GET /api/v1/comment/show
API Response Body - Success result
{
"response": "success",
"reason": "Comment search completed",
"data": [
{
"timestamp": "2018-01-13T02:26:55Z",
"created_by": "roshan",
"casename": "CASE-ALFA-02",
"computername": "COMPUTER-01",
"audit": "w32tasks",
"doc_id": "aaaaaaaaaabbbbbbb",
"comment": "This is comment about task"
},
{
"timestamp": "2018-01-13T02:34:29Z",
"created_by": "roshan",
"casename": "CASE-ALFA-02",
"computername": "COMPUTER-02",
"audit": "wservices",
"doc_id": "bbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"comment": "Odd looking services. Potential malicious"
}
]
}
API Response Body - Failed result
{
"response": "failed",
"reason": "Comment not found",
"data": null
}