HTTP Verbs
Verb |
Usage |
|
Used to retrieve a resource |
|
Used to create a new resource |
|
Used to update an existing resource, including partial updates |
|
Used to delete an existing resource |
HTTP Status Codes
Status Code |
Usage |
|
The request completed successfully |
|
A new resource has been created successfully. The resource’s URI is available from the response’s
|
|
An update to an existing resource has been applied successfully |
|
The request was malformed. The response body will include an error providing further information |
|
The requested resource did not exist |
|
An error occurred while processing request |
GET /api/v1/index HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 17
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Hello Spring Base
Register System User
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 908
{
"status" : 400,
"title" : "Validation Failed",
"detail" : null,
"timestamp" : "2023-04-04T04:50:11.546541934",
"errorCount" : 6,
"errors" : [ {
"field" : "password",
"rejectedValue" : null,
"message" : "Properties does not match"
}, {
"field" : "email",
"rejectedValue" : null,
"message" : " can not be null or blank"
}, {
"field" : "verifyPassword",
"rejectedValue" : null,
"message" : " can not be null or blank"
}, {
"field" : "password",
"rejectedValue" : null,
"message" : " can not be null or blank"
}, {
"field" : "username",
"rejectedValue" : null,
"message" : " can not be null or blank"
}, {
"field" : "fullName",
"rejectedValue" : null,
"message" : " can not be null or blank"
} ],
"message" : "Request can not be processed due to one or more validation error",
"path" : "/api/v1/system/users"
}
HTTP/1.1 403 Forbidden
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 247
{
"status" : 403,
"title" : null,
"detail" : null,
"timestamp" : "2023-04-04T04:50:11.574512949",
"errorCount" : 0,
"errors" : null,
"message" : "Can not create System User. Users already exists.",
"path" : "/api/v1/system/users"
}
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 654
{
"status" : 200,
"title" : null,
"detail" : {
"id" : 1,
"username" : "system",
"password" : "123456",
"fullName" : "System User",
"email" : "system@sytem.com",
"enabled" : true,
"accountNonExpired" : true,
"accountNonLocked" : true,
"credentialsNonExpired" : true,
"credentialsExpiryDate" : null,
"version" : 0,
"createdAt" : "2023-04-04T04:50:11.49362081",
"lastModifiedAt" : "2023-04-04T04:50:11.493638911",
"permanentDelete" : false,
"authorities" : [ ]
},
"timestamp" : "2023-04-04T04:50:11.522142563",
"errorCount" : 0,
"errors" : null,
"message" : null,
"path" : null
}
Manage Users
Create User
POST /api/v1/manage/users HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 446
Host: localhost:8080
{
"id" : null,
"username" : "username",
"password" : "Password",
"fullName" : "System",
"email" : "email@gmail.com",
"enabled" : true,
"accountNonExpired" : true,
"accountNonLocked" : true,
"credentialsNonExpired" : true,
"credentialsExpiryDate" : null,
"version" : 0,
"createdAt" : "2023-04-04T04:50:10.726938413",
"lastModifiedAt" : "2023-04-04T04:50:10.726955014",
"permanentDelete" : false,
"authorities" : [ ]
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 587
{
"status" : 400,
"title" : "Validation Failed",
"detail" : null,
"timestamp" : "2023-04-04T04:50:10.597243632",
"errorCount" : 3,
"errors" : [ {
"field" : "username",
"rejectedValue" : null,
"message" : " can not be null or blank"
}, {
"field" : "password",
"rejectedValue" : null,
"message" : " can not be null or blank"
}, {
"field" : "email",
"rejectedValue" : null,
"message" : " can not be null or blank"
} ],
"message" : "Request can not be processed due to one or more validation error",
"path" : "/api/v1/manage/users"
}
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 653
{
"status" : 200,
"title" : null,
"detail" : {
"id" : 1,
"username" : "username",
"password" : "Password",
"fullName" : "System",
"email" : "email@gmail.com",
"enabled" : true,
"accountNonExpired" : true,
"accountNonLocked" : true,
"credentialsNonExpired" : true,
"credentialsExpiryDate" : null,
"version" : 0,
"createdAt" : "2023-04-04T04:50:10.726972115",
"lastModifiedAt" : "2023-04-04T04:50:10.726976115",
"permanentDelete" : false,
"authorities" : [ ]
},
"timestamp" : "2023-04-04T04:50:10.739800093",
"errorCount" : 0,
"errors" : null,
"message" : null,
"path" : null
}
Update User
PUT /api/v1/manage/users/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 443
Host: localhost:8080
{
"id" : 1,
"username" : "username",
"password" : "Password",
"fullName" : "System",
"email" : "email@gmail.com",
"enabled" : true,
"accountNonExpired" : true,
"accountNonLocked" : true,
"credentialsNonExpired" : true,
"credentialsExpiryDate" : null,
"version" : 0,
"createdAt" : "2023-04-04T04:50:10.760595517",
"lastModifiedAt" : "2023-04-04T04:50:10.760609518",
"permanentDelete" : false,
"authorities" : [ ]
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 216
{
"status" : 400,
"title" : null,
"detail" : null,
"timestamp" : "2023-04-04T04:50:10.770548499",
"errorCount" : 0,
"errors" : null,
"message" : "Record Not Found",
"path" : "/api/v1/manage/users/1"
}
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 653
{
"status" : 200,
"title" : null,
"detail" : {
"id" : 1,
"username" : "username",
"password" : "Password",
"fullName" : "System",
"email" : "email@gmail.com",
"enabled" : true,
"accountNonExpired" : true,
"accountNonLocked" : true,
"credentialsNonExpired" : true,
"credentialsExpiryDate" : null,
"version" : 0,
"createdAt" : "2023-04-04T04:50:10.798761931",
"lastModifiedAt" : "2023-04-04T04:50:10.798773632",
"permanentDelete" : false,
"authorities" : [ ]
},
"timestamp" : "2023-04-04T04:50:10.802063557",
"errorCount" : 0,
"errors" : null,
"message" : null,
"path" : null
}
Delete User
DELETE /api/v1/manage/users/1 HTTP/1.1
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 205
{
"status" : 200,
"title" : null,
"detail" : "User Deleted Successfully",
"timestamp" : "2023-04-04T04:50:10.790058935",
"errorCount" : 0,
"errors" : null,
"message" : null,
"path" : null
}