Technical Tip: How to add a new entry for webfilter URL filter in FortiManager via the API
Description
This article describes how to add a new entry for a webfilter URL filter in FortiManager via the API.
Scope
FortiManager.
Solution
The API can be used to add a new entry to webfiler.urlfilter entries without overwriting the existing entries in the FortiManager ADOM database.
The following example shows the API Request which can be used to add a new entry (in this case, 'www.url-001.com') in the webfilter.urlfilter with the ID 1 in the Test ADOM.
The following is the API Request code:
{
"id": 3,
"method": "add",
"params": [
{
"data": {
"url": "www.url-001.com"
},
"url": "/pm/config/adom/Test/obj/webfilter/urlfilter/1/entries"
}
],
"session": "{{session}}"
}
Upon successful creation, the response should return 'OK'.
{
"id": 3,
"result": [
{
"data": {
"id": 1
},
"status": {
"code": 0,
"message": "OK"
},
"url": "/pm/config/adom/Test/obj/webfilter/urlfilter/1/entries"
}
]
}