Technical Tip: How to create and update configuration object with RESTful API
Description
Since firmware version v6.3.6, new RESTful API has been introduced in FortiWeb from v1.0 to v2.0.
This article describes how to create and update configuration object with RESTful API.
Scope
For version 6.3.6 and above.
Solution
Example configuration section:

curl -i --insecure --location --request GET 'https://{host}/api/v2.0/cmdb/waf/ip-list' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json'
curl -i --insecure --location --request GET 'https://{host}/api/v2.0/cmdb/waf/ip-list?mkey=protection' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json'
curl -i --insecure --location --request PUT 'https://{host}/api/v2.0/cmdb/waf/ip-list/members?mkey=protection&sub_mkey=1' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json' --data '{"data":{ "type": "black-ip"}}'
curl -i --insecure --location --request POST 'https://{host}/api/v2.0/cmdb/waf/ip-list/members?mkey=protection' --header 'Authorization: xxxxxxxxxxxxxx' --header 'Accept: applicaiton/json' --data '{"data":{ "seq": 3, "id": "3", "type": "black-ip", "ip": "3.3.3.3"}}'

https://documenter.getpostman.com/view/11233300/SzmZbfBD?version=latest
Related links:
https://docs.fortinet.com/document/fortiweb/6.3.6/release-notes
https://documenter.getpostman.com/view/11233300/SzmZbfBD?version=latest




