ASE REST API allows you to manage adding, removing, and modifying your backend servers. The REST API payload uses a JSON format. REST API also helps in integrating ASE with third-party products. The default port for ASE REST API is 8010.
The following is a list of formats for ASE’s REST APIs:
- Create API (POST) – Inline and sideband ASE
- Read API (GET) – Inline and sideband ASE
- List API (GET) – Inline and sideband ASE
- Update API (PUT) – Inline and sideband ASE
- Create Server (POST) – Inline ASE
- Read Server (GET) – Inline ASE
- Delete Server (DELETE) – Inline ASE
- Read Cluster (GET) – Inline ASE
- Read Persistent Connections (GET) – Inline ASE
- Read Firewall Status (GET) – Inline and sideband ASE
- Update Firewall Status (POST) – Inline and sideband ASE
- Add Attack Type to Blacklist (POST) – Inline and sideband ASE
- Delete Attack Type from the Whitelist (DELETE) – Inline and sideband ASE
- Clear the Blacklist (DELETE) – Inline and sideband ASE
- View Blacklist (GET) – Inline and sideband ASE
- Add Attack Type to Whitelist (POST) – Inline and sideband ASE
- Delete Attack Type from the Whitelist (DELETE) – Inline and sideband ASE
- Clear Whitelist (DELETE) – Inline and sideband ASE
- View Whitelist (POST) – Inline and sideband ASE
- Read Flow Control of an API (GET) – Inline ASE
- Update Flow Control for an API (POST) – Inline ASE
- Update Flow Control for a Server of an API (POST) – Inline ASE
Common request headers
Header | Value |
---|---|
x-ase-access-key
|
Note: The default and only allowed access key is
admin . |
x-ase-secret-key
|
Note: The default secret key is
admin . You can change the default secret
key using the update_passowrd command. |
Accept
|
application/json
|
Create API (POST)
Request
POST
|
/v4/ase/api?api_id=sample_api
|
Content-Type
|
application/json
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
REST API request
{
"api_metadata": {
"protocol": "http",
"url": "/your_rest_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
WebSocket API request
{
"api_metadata": {
"protocol": "ws",
"url": "/your_websocket_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"bytes_in_threshold": "0/second",
"bytes_out_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
403
|
fail
|
|
403
|
fail
|
|
Read API (GET)
Request
GET
|
/v4/ase/api?api_id=sample_api
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
REST API
WebSocket API
|
404
|
not found
|
|
List API (GET)
Request
GET
|
/v4/ase/api
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
404
|
not found
|
|
Update API (PUT)
Request
PUT
|
/v4/ase/api?api_id=sample_api
|
Content-Type
|
application/json
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
REST API request
{
"api_metadata": {
"protocol": "http",
"url": "/your_rest_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
WebSocket API request
{
"api_metadata": {
"protocol": "ws",
"url": "/your_websocket_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"bytes_in_threshold": "0/second",
"bytes_out_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
404
|
fail
|
|
Delete API (DELETE)
Request
DELETE
|
/v4/ase/api?api_id=sample_api
|
x-ase-access-key
|
<Access Key> |
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
404
|
fail
|
|
Create server (POST)
Request
POST
|
/v4/ase/server?api_id=<api>
|
Content-Type
|
application/json
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
REST API request
{
"server":
{
"host": "192.168.1.100",
"port": 8080,
"server_spike_threshold": "1/second",
"server_connection_quota": 100
}
}
WebSocket API Request
{
"server":
{
"host": "192.168.1.100",
"port": 8080,
"server_connection_quota": 100
}
}
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
404
|
fail
|
|
403
|
fail
|
|
403
|
fail
|
|
Read server (GET)
Request
GET
|
/v4/ase/server?api_id=<api_id>
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
REST API
WebSocket API
|
404
|
fail
|
|
Delete server (DELETE)
Request
DELETE
|
/v4/ase/server?api_id=<api>
|
Content-Type
|
application/json
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
{
“server”:
{
"host" : “192.168.1.100”,
"port" : 8080
}
}
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
404
|
fail
|
|
404
|
fail
|
|
403
|
fail
|
|
Read cluster (GET)
Request
GET
|
/v4/ase/cluster
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
404
|
fail
|
|
Read persistent connections (GET)
Request
GET
|
/v4/ase/persistentconnection?api_id=sample
|
x-ase-access-key
|
<Access Key>
|
x-ase-secret-key
|
<Secret Key>
|
Accept
|
application/json
|
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
|
404
|
fail
|
|
Read firewall status (GET)
Request
GET
|
/v4/ase/firewall
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
Response
HTTP code | Status | Content body (application/json) |
200
|
success
|
|
Update firewall status (POST)
Request
POST
|
/v4/ase/firewall?status=enable/disable
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
Response
HTTP Code | Status | Content body (application/json) |
200
|
success
|
If there is a status change
If there is no change in status
|
403
|
fail
|
|
Add attack type to blacklist (POST)
Request
POST
|
/v4/ase/firewall/blacklist
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
===============for IP===============
{
"type" : "ip",
"value" : "1.1.1.1"
}
===============for Token=============
{
"type" : "token",
"value" : "sadjhasiufgkjdsbfkgfa"
}
=============for Cookie/api_key=======
{
"type" : "cookie/token/api_key",
"name" : "JSESSIONID",
"value" : "ljkhasioutfdqbjsfdmakhflia"
}
Response
Status code | Response body |
200 OK
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia added to
blacklist |
403 Forbidden
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia already exist |
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
403 Forbidden
|
json parsing error
|
500 Internal Server Error
|
unknown error
|
Delete attack type to blacklist (DELETE)
Request
DELETE
|
/v4/ase/firewall/blacklist
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
===============for IP===============
{
"type" : "ip",
"value" : "1.1.1.1"
}
===============for Token=============
{
"type" : "token",
"value" : "sadjhasiufgkjdsbfkgfa"
}
=============for Cookie/api_key=======
{
"type" : "cookie/token/api_key",
"name" : "JSESSIONID",
"value" : "ljkhasioutfdqbjsfdmakhflia"
}
Response
Status code | Response body |
200 OK
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia deleted from
blacklist |
403 Forbidden
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia already exist |
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
403 Forbidden
|
json parsing error
|
500 Internal Server Error
|
unknown error
|
Clear the blacklist (DELETE)
Request
DELETE
|
/v4/ase/firewall/blacklist?tag=all
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
Response
Status code | Response body |
200 OK
|
Blacklist cleared
|
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
500 Internal Server Error
|
unknown error
|
View blacklist (GET)
Request
GET
|
/v4/ase/firewall/blacklist?tag=
|
Tags
|
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
Response
Status code | Response body |
200 OK
|
|
403 Forbidden
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia already exist |
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
500 Internal Server Error
|
unknown error
|
Add attack type to whitelist (POST)
Request
POST
|
/v4/ase/firewall/whitelist
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
===============for IP===============
{
"type" : "ip",
"value" : "1.1.1.1"
}
===============for Token=============
{
"type" : "token",
"value" : "sadjhasiufgkjdsbfkgfa"
}
=============for Cookie/api_key=======
{
"type" : "cookie/token/api_key",
"name" : "JSESSIONID",
"value" : "ljkhasioutfdqbjsfdmakhflia"
}
Response
Status code | Response body |
200 OK
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia added to
whitelist |
403 Forbidden
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia already exist |
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
403 Forbidden
|
json parsing error
|
500 Internal Server Error
|
unknown error
|
Delete attack type from the whitelist (DELETE)
Request
DELETE
|
/v4/ase/firewall/whitelist
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
===============for IP===============
{
"type" : "ip",
"value" : "1.1.1.1"
}
===============for Token=============
{
"type" : "token",
"value" : "sadjhasiufgkjdsbfkgfa"
}
=============for Cookie/api_key=======
{
"type" : "cookie/token/api_key",
"name" : "JSESSIONID",
"value" : "ljkhasioutfdqbjsfdmakhflia"
}
Response
Status code | Response body |
200 OK
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia added to
whitelist |
403 Forbidden
|
Cookie JSESSIONID ljkhasioutfdqbjsfdmakhflia already exist |
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
403 Forbidden
|
json parsing error
|
500 Internal Server Error
|
unknown error
|
Clear whitelist (DELETE)
Request
DELETE
|
/v4/ase/firewall/whitelist?tag=all
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
Response
Status code | Response body |
200 OK
|
Whitelist cleared
|
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
500 Internal Server Error
|
unknown error
|
View whitelist (POST)
Request
GET
|
/v4/ase/firewall/whitelist
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
Response
Status code | Response body |
200 OK
|
|
403 Forbidden
|
content-type header missing
|
403 Forbidden
|
x-ase-access-key header missing
|
403 Forbidden
|
x-ase-secret-key header missing
|
403 Forbidden
|
authorization failure
|
500 Internal Server Error
|
unknown error
|
Read flow control of an API (GET)
Request
GET
|
/v4/ase/firewall/flowcontrol?api_id=<api_name>
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
Response
HTTP code | Status | Content body (application/json) |
200
|
success
|
Flow control for REST API
Flow control for WebSocket API
|
403
|
fail
|
|
404
|
fail
|
|
Update flow control for an API (POST)
Request
POST
|
/v4/ase/firewall/flowcontrol?api_id=<api_name>
|
x-ase-access-key
|
|
x-ase-secret-key
|
|
Accept
|
application/json
|
REST APIs
{ "flow_control": {
"client_spike_threshold": "0/second"
}
}
WebSocket APIs
{ "flow_control": {
"client_spike_threshold": "10/second",
"bytes_in_threshold": "10/second",
"bytes_out_threshold": "10/second"
}
}
Response
HTTP code | Status | Content body (application/json) |
200
|
success
|
Flow control for REST APIs
Flow control for WebSocket APIs
|
403
|
fail
|
|
404
|
fail
|
|
Update flow control for a server of an API (POST)
Request
POST
|
/v4/ase/firewall/flowcontrol/server?api_id=<api_name>
|
x-ase-access-key
|
|
x-ase-secret-key
|
<<Secret Key>
|
Accept
|
application/json
|
REST APIs
{
"server":
{
"host": "127.0.0.2",
"port": 8080,
"server_connection_quota": 1000,
"server_spike_threshold": "10/second"
}
}
WebSocket APIs
{
"server":
{
"host": "127.0.0.2",
"port": 8080,
"server_connection_quota": 100000
}
}
Response
HTTP code | Status | Content body (application/json) |
200
|
success
|
|
403
|
fail
|
|
404
|
fail
|
|