FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
Article Id 196540
This article provides a basic guideline to use REST API access FortiGate.
Traditionally, SSH and WEBGUI access to FortiGate are used. However, FortiGate provides another interface, REST API, that is for programmer to develop other features such as DevOps and automation. It is simple and easy to use.

Useful link:
Fortinet documentation: For detailed documents and tools, join

FortiGate REST API:

1) How to login to FortiGate
# curl -k -i -X POST https://x.x.x.x/logincheck -d "username=yyy&secretkey=zzz" --dump-header headers.txt -c cookies.txt
x.x.x.x  is FortiGate IP address
yyy     is administrator name
zzz     is administrator’s password

This will generate 2 files:

headers.txt:   It contains all information about the authentication. This file will be needed for GET commands
cookies.txt:   It contain the cookie generated for the authentication. This file will be needed for POST commands

2) How to GET static route
#curl -k -i -X GET https://x.x.x.x/api/v2/cmdb/router/static -b headers.txt

3) How to logout
#curl -k -i -X POST https://x.x.x.x/logout