FortiPortal 7.0.0 REST API Guide
FortiPortal 7.0.0 REST API Guide
FortiPortal 7.0.0
FORTINET DOCUMENT LIBRARY
https://docs.fortinet.com
FORTINET BLOG
https://blog.fortinet.com
NSE INSTITUTE
https://training.fortinet.com
FORTIGUARD CENTER
https://www.fortiguard.com
FEEDBACK
Email: techdoc@fortinet.com
July 4, 2022
FortiPortal 7.0.0 REST API Guide
37-700-735203-20220704
TABLE OF CONTENTS
Change Log 7
Introduction 8
REST API background 8
Available API methods 8
FortiPortal API methods 10
Admin log in and log out 10
Customers and customer users 10
Customer Sites Provisioning 11
FortiAnalyzer 12
FortiManager 12
System Provisioning 13
User Provisioning 14
Using the API 15
Accessing the API 15
Headers 15
URL parameters 15
JSON payload parameters 15
Success response structure 16
Failure response structure 16
Authentication 16
Authentication example 16
Python examples 17
Basic setup (use this code for each example) 17
Retrieve a collection 17
Retrieve an object 17
API HTTP response codes 17
API reference 19
Logging in and out 19
Admin log In 19
Admin log out 19
Customers 20
Get all customers 20
Get a specific customer 20
Create a new customer 21
Edit an existing customer 22
Delete a customer record 22
Customer ADOMs 23
Display ADOMs assigned to a customers 23
Create or update a list of ADOMs for a customer 23
FortiAnalyzer reports for a customer 24
Assign FortiAnalyzer reports to a customer 24
Unassign FortiAnalyzer reports from a customer 25
Get unassigned FortiAnalyzer reports that the specified customer can assign 25
This document provides information about the REST API supported by FortiPortal 7.0.0.
API responses include data in JSON format. Each API response also includes an HTTP response code, to indicate the
success or failure of the operation.
A RESTful API uses standard HTTP methods (Get, Post, Delete) to provide interactions between a client and a server.
The API is stateless - each request is independent.
The following operations are supported by a RESTful API:
1. Fetch data by sending a GET request
2. Add data by sending a POST request
3. Update data by sending a POST request
4. Delete data by sending a DELETE request
GET and DELETE are idempotent. The operation will produce the same result no matter how many times it is repeated.
b. Sites
i. List sites
ii. Add new site
iii. Edit an existing site
iv. Delete the site
c. Wifi Networks
i. Add, edit, and delete wireless networks
2. User Provisioning
a. Users
i. List users
ii. Add new user (customer or server provider user)
iii. Edit an existing user
iv. Delete the user
v. List roles assigned to the user
3. System Provisioning
a. FortiManager
i. List, add, edit, and delete the FortiManager
ii. FortiManager polling
b. FortiAnalyzer
i. List all connected FortiAnalyzer units
ii. Add, edit, or delete the FortiAnalyzer unit
iii. Update the FortiAnalyzer report list
iv. List FortiAnalyzer report templates
c. List all devices and the associated customer
d. List the available devices that can be assigned to customer sites
e. List all FAPs and the associated customer
f. List all roles and the permissions for each role
g. Get cloud usage for customers
h. Display audit and alert logs
i. List policy installations for all customers in a specified time range
The FortiPortal provides the following API methods. You need to log in to the API using a valid Admin User account (not
a customer user account) before you can use the other API methods.
POST /login Log in to the FortiPortal with user name and password
GET /customers/{cid}/sites/{sid}/wifinetworks/{id} List the WiFi network information for a particular WiFi
network ID
FortiAnalyzer
FortiManager
GET /fortimanagers/{fmid}/pollnow The poll updates the list of FortiManager devices in the
FortiPortal.
System Provisioning
GET /devices?haRole=master and /devices?haRole=slave List all primary devices or all secondary
devices, depending on the value specified.
GET /auditlogs?Start_date= "MM/dd/yyyy" &End_date= List audit logs for the specified time range or
"MM/dd/yyyy" or /auditlogs?frequencyValue=<time> the specified number or days or hours
GET /widgets/?type=<type> Type can be either “SP” or Get Widgets resource by type. To get list of
“CUST” Widget that can be assigned to customer
use CUST
User Provisioning
This chapter provides details on accessing and authenticating the FortiPortal API.
See Accessing the API on page 15 and Authentication on page 16.
Create web requests using HTTP Get or Post message with the following fields:
https://<ipaddress>:<port>/fpc/api/<path parameters>
Headers
URL parameters
FortiPortal API follows the standard REST format for the request URLs.
In a request to get all entries of a collection, or to add a new entry to a collection, the URL includes the collection name.
In a request to get, update or delete a specific member of a collection, the URL includes the collection name and the
index of the specific entry. For a nested collection (such as customer sites), the URL may contain more than one index
(one for customer ID, one for site ID).
The URL parameters are always mandatory. If you do not provide a valid ID for each index in the request URL, the
request will result in a failure response.
In the methods to add a new entry or update an existing entry in a collection, the payload contains the input fields for the
entry. The payload information is sent as text in JSON format.
Some input fields are required, and some are optional. You must provide values for the required fields. The
API Reference chapter lists the required and optional fields for each API method.
Authentication
To initiate requests to the FortiPortal REST API, you need to log in to the FortiPortal. Send a POST request using the
following format:
https://<ipaddress>:<port>/fpc/api/login
Authentication example
The following example shows the contents of the request message and the response:
HTTP post message:
url: https://10.0.0.1/fpc/api/login
Content-type: application/json
Payload:
{
“user” : “spuser”,
“password” : “test123”
}
Response message:
Status : 200 OK
Payload:
{
“sid” : “8478V00xYhva_ndcihDi203ru3c1auaUb1icew0W_TT”
}
Python examples
The following snippets of Python code provide examples of how to use the FortiPortal API.
The following example shows how to log in to the API, and retrieve the session ID from the response message:
url_login="https://10.16.0.42/fpc/api/login"
client = requests.session()
#Login request
payload = {'user' : 'myuser', 'password' : 'mypass'}
r = client.post(url_login, json=payload, verify=False )
Retrieve a collection
The following example shows how to gather all customer users for customer index 1:
url_cust_req="https://10.16.0.42/fpc/api/customers/1/users"
r = client.get(url_cust_req, headers=headers, verify=False)
Retrieve an object
The API returns an HTTP status code to indicate the disposition of the request:
403 Forbidden Request is missing the CSRF token or administrator is missing access profile
permissions
405 Method Not Allowed Specified HTTP method is not allowed for this resource
This chapter provides details about each of the API methods. You need to log in to the FortiPortal using admin user
credentials before using the other API methods.
Admin log In
Outputs
fpc-sid string Unique session identifier. Include this value in the fpc-sid header for
each subsequent request
Arguments
None.
Outputs
None.
Customers
Arguments
None
Outputs
JSON array Array of customer records. One entry per customer, each record
contains a unique customer ID (cid). See the customer record table.
Arguments
collectorStoragePercentage string Collector total percentage (the rest is for portal usage)
POST /customers/ Create a new customer See the next table. cid
Outputs
POST /customers/{cid} Update the customer record for See the next table. none
an existing customer
Arguments
Arguments
No outputs.
Customer ADOMs
Arguments
Outputs
Arguments
POST /customers/ Assign one or more available See the following HTTP Response
{cid}/assignfazreports FortiAnalyzer reports to a tables. 200 OK
specific customer
Arguments
Reportids List (integer) Required. Identifiers for one or more FortiAnalyzer reports to be
assigned to the customer
Outputs
POST /customers/ Unassign one or more See the following HTTP Response
{cid}/unassignfazreports available FortiAnalyzer tables. 200 OK
reports from a specific
customer
Arguments
Reportids List (integer) Required. Identifiers for one or more FortiAnalyzer reports to be
unassigned from the customer
Outputs
Get unassigned FortiAnalyzer reports that the specified customer can assign
Arguments
startTime string The start time of the period covered by the report
endTime string The end time of the period covered by the report
Arguments
startTime string The start time of the period covered by the report
endTime string The end time of the period covered by the report
Arguments
Outputs
Customer domain
GET /customers/ List all sites for a particular cid See the Outputs
{cid}/domains customer table.
Arguments
Outputs
GET /customers/ Create or update a domain See the next table. 200 OK
{cid}/domains under a customer
Arguments
GET /customers/ Display policy tab permission cid See the Outputs
{cid}/policyobjects resource under a customer table.
Arguments
Outputs
POST /customers/ Create or update policy and See the next table. 200 OK
{cid}/policyobjects object permission resource
under a customer
GET /customers/ Display policy tab permission cid See the Outputs
{cid}/policytabs resource under a customer table.
Arguments
Outputs
GET /customers/ Create or update policy tab See the next table. 200 OK
{cid}/policytabs permission resource under a
customer
GET /customers/ Display tab permission under a cid See the Outputs
{cid}/tabs customer table.
Arguments
Outputs
POST /customers/ Create or update tabs See the next table. 200 OK
{cid}/tabs permission under a customer
Arguments
Outputs
POST /customers/ Create or update widget See the next table. 200 OK
{cid}/widgets permissions of a customer
FortiAnalyzer
FortiPortal contains a record for each FortiAnalyzer that is registered in this FortiPortal.
Arguments
None
Arguments
POST /fortianalyzers Create a new FortiAnalyzer See the next table. faid
record
Outputs
Arguments
Outputs
Arguments
Outputs
GET /fortianalyzers/ Update the list of FortiAnalyzer faid HTTP Response 200
{faid}/pollnow reports. OK
Arguments
Arguments
FortiManager
FortiPortal contains a record for each FortiManager that is registered in this FortiPortal.
Arguments
None
Outputs
JSON array Array of FortiManager records, one entry per FortiManager. Each
record contains a unique FortiManager ID. See the FortiManager
Record table.
GET /fortimanagers/{fmid} Retrieve information for the fmid See the Outputs
specified FortiManager table.
Arguments
FortiManager polling
Arguments
frequencyValue String Yes Polling frequency (No polling, daily, weekly or monthly).
Outputs
Arguments
Outputs
None.
Arguments
Outputs
None.
Valid date formats are ’yyyy-MM-dd HH:mm’ or ’yyyy-MM-dd HH:mm:ss’; other formats result in an invalid date error
response.
GET /fpc/api/customers/ Return a list of policy cid, Startdate, See the Outputs
{cid}/installs/?startdate=’yyyy- installations executed for Enddate table.
MM-dd HH:mm:ss’&enddate= the customer
’yyyy-MM-dd HH:mm:ss'
Argument—Path
Arguments—Query
Startdate (required) string Startdate: start of date range. Date format : ‘yyyy-MM-dd HH:mm:ss’
Enddate (required) string Enddate: end of date range. Date format : ‘yyyy-MM-dd HH:mm:ss’
Outputs
Id int Installation ID
GET /fpc/api/customers/ Get details of policy installation See the next table. See the Output
{cid}/installs/ for given install id table.
{installid}
Output
FortiPortal contains a record for each site that is defined for a customer.
GET /customers/ List all sites for a particular cid JSON array
{cid}/sites customer
Arguments
Outputs
JSON array Array of customer site records. One entry per customer site, each
record contains a unique site ID. See the Customer Site Record table.
GET /customers/ List the user information for a cid, sid customer site record
{cid}/sites/{sid} particular site id
Arguments
The network name must be 45 or fewer characters. The system does not support more than 45 characters for a network
name.
POST /customers/ Create a new site for a particular See the next table. cid
{cid}/sites customer
Arguments
networkName String Y Name of the network. NOTE: The network name must be
45 or fewer characters. The system does not support
more than 45 characters for a network name.
Outputs
The name of a customer site must be 45 or fewer characters. The system does not support more than 45 characters for a
customer site name.
POST /customers/ Edit an existing site. See the next table. none
{cid}/sites/{sid}
Arguments
customer site fields JSON payload See Arguments (customer WiFi network fields).
Arguments
No outputs.
Customer user
FortiPortal contains a record for each user that is defined for a customer.
GET /customers/ List all users for a particular cid JSON array
{cid}/users customer
Arguments
Outputs
JSON array Array of customer user records. One entry per customer user, each
record contains a unique user ID. See the Customer User Record
table.
See the Customer User Record table for the contents of a customer user record.
GET /customers/ List the user information for a cid, uid customer user
{cid}/users/{uid} particular user id record
Arguments
POST /customers/ Create a new user under a See the next table. cid
{cid}/users particular customer
Arguments
country Country
Outputs
POST /customers/ Edit the existing user information See the next table. none
{cid}/users/{uid}
Arguments
customer user fields JSON payload See the Arguments (customer user fields) table.
Arguments
No outputs.
Customer widgets
FortiPortal contains a record for each widget that a customer is using in the customerʼs portal dashboard.
GET /customers/ List all widgets for a particular cid JSON array
{cid}/widgets customer
Arguments
Outputs
FortiPortal contains a record for each WiFi network that is defined for the specified customer site.
GET /customers/ List all WiFi networks for a cid, sid JSON array
{cid}/sites/ particular customer
{sid}/wifinetworks
Arguments
Outputs
JSON array Array of customer WiFi network records. One entry per WiFi network,
each record contains a unique network ID. See the Customer Wifi
Network Record table.
GET /customers/ List the WiFi network information cid, sid, customer WiFi
{cid}/sites/ for a particular network id wifiNetworkId network record
{sid}/wifinetwork/
{wifiNetworkId}
Arguments
POST /customers/ Create a new network for a See the next table. wifiNetworkId
{cid}/sites/ particular customer
{sid}/wifinetworks
Arguments
Outputs
POST /customers/ Edit an existing WiFi network. See the next table. none
{cid}/sites/
{sid}/wifinetwork/
{wifiNetworkId}
Arguments
Outputs
None.
POST /customers/{cid}/sites/ Delete the customer WiFi See the next table none
{sid}/wifinetworks/delete/ network.
{wifiNetworkId}
Arguments
Outputs
None.
System provisioning
GET /devices or /devices?status= Retrieve all devices none required JSON array
Arguments
haRole string If the value is primary, all primary devices are returned. If the value
is secondary, all secondary devices are returned. NOTE: the values
are case sensitive; use all lower-case letters for primary and
secondary.
status string If no value is specified, all devices are returned. If the value is
available, the devices that can be assigned to customer sites are
returned.
Outputs
version String The value is orignal, new, or old. Devices with a new or
original version can be assigned to the customer if they are not
associated with any other customer.
GET /adoms Retrieve all ADOMs and the none JSON array
customers assigned to each
one.
Arguments
None.
Outputs
customers JSON object List of customer ID and customer names assigned to the adom
Arguments
None.
Outputs
GET /roles/{roleId} Retrieve the specified role roleId See the Outputs
table.
Arguments
Outputs
Permissions JSON array Each entry includes the permission name and permission ID.
Arguments
None.
Outputs
GET /auditlogs?Start_date= "MM/dd/yyyy" &End_date= Retrieve the See the next JSON array
"MM/dd/yyyy" or /auditlogs?frequencyValue=<time> audit logs for section.
the specified
time range or
the specified
number or
days or hours.
frequencyValue String The number of hours or days of audit logs. If frequencyValue is not
specified, the default is one day.
Start_date datetime Start date. The format is "MM/dd/yyyy". If the date range is not
specified, the default is one day.
End_date datetime End date. The format is "MM/dd/yyyy". If the date range is not
specified, the default is one day.
pageStart int The starting row number for the records to return. If pageStart is not
specified, the default is 0.
pageLength int The number of records per page to return. If pageLength is not
specified, the default is 100 records per page. The maximum value is
1000 records per page.
Outputs
Get alerts
GET /alerts Retrieve list the alert logs for a See the next table. JSON array
given date range.
By default, returns Alerts for SP
for 1 day range.
Outputs
alertReceiver String Name of the SP or customer that the receiver for this alert message.
GET /cloudusage Retrieve cloud usage for all None See the next table.
customers
Outputs
GET /cloudusage/{cid} Retrieve cloud usage for the cid See the Outputs
specified customer. table.
Arguments
Outputs
Get countries
GET /countries Retrieve a list of all countries in None See the next table.
the FortiPortal database.
Outputs
countryCode String Short code for the country (for example, “US”)
GET /countries/ Get details for the specified countryId See below.
{countryId} country.
Arguments
Outputs
countryCode String Short code for the country (for example, “US”)
GET /installs/?startdate=’yyyy- Get policy installations for all startdate, enddate See the following
MM-dd customers in a specified table.
HH:mm:ss’&enddate= time range
’yyyy- MM-dd HH:mm:ss
Arguments
Startdate (required) string Startdate: start of date range. Date format : ‘yyyy-MM-dd HH:mm:ss’
Enddate (required) string Enddate: end of date range. Date format : ‘yyyy-MM-dd HH:mm:ss’
Outputs
countryCode String Short code for the country (for example, “US”)
Users
FortiPortal contains a record for each service provider user and customer user in the system. You can use these API
endpoints to create a new service provider user.
Arguments
Outputs
POST /users Create a new service provider See the next table. userId
user
Outputs
Utility widget
A validation exists to check for valid widgetId, which are of type "CUST." The following API can be used to acquire a list
of all widgets that can be applied to the customer.
GET /customers/ List all widgets resource type See the Outputs
{cid}/widgets/?type=<type> of type (either SP or table.
CUST depending upon
query parameter (SP,
default))
Arguments
Outputs
License
Arguments
Outputs
Arguments
None
Outputs
You can access the API from most browsers using the GET method.
The examples in this chapter make requests using cURL, which is more flexible than using a browser alone, works
across platforms, and most scripts can call it. Using cURL is not as flexible as native scripting languages, but it is useful
for illustrating how the API functions.
Log in
Request
Headers
Content-type: application/json
Payload
{
“user” : “spuser”,
“password” : “test123”
}
Response
Status : 200 OK
{
“sid” : “8478V00xYhva_ndcihDi203ru3c1auaUb1icew0W_TT”
}
This example shows how to create a new site for the customer with ID.
Request
Headers
Content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Payload
{
“networkName” : “site1”,
“contactName” : “Peter”,
“contactEmail” : peter@fortinet.com,
“contactPhone” : “408-235-7700”
“fpcDeviceModels”: [ {"deviceId" : 3},{"deviceId" : 2}]
}
Response
Status : 200 OK
{
“networked” : 5
}
Request
GET http://localhost:8080/fpc/api/customers/{cid}/commentnamebasedfilters
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
{
"customerId" : 6,
"commentBasedFilter" : ["new1", "hello1"],
"nameBasedFilter" : ["go", "good"]
}
Request
POST http://localhost:8080/fpc/api/customers/{cid}/commentnamebasedfilters
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"customerId" : 6,
"commentBasedFilter" : ["new filters", "pfilter"],
"nameBasedFilter" : ["objfilter1", "cs22"]
}
Response
Status 200 OK
Validation
If domain names are not unique, more than 10, or does not satisfy characters criteria, it will respond as Status 400 Bad
Request and with message as follows:
l {"domainNames": "Domain Name must be unique, xyz.com,def.com already exists"}
l {"domainNames": "Domain Name (xdfd23232!@#yzcom) is Invalid"}
l { "domainNames": "Domain Names count reached max limit of 10"}
Customers domain
GET example
Request
GET http://localhost:8080/fpc/api/customers/1/domains
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
{
"domainId": 1,
"domainNames": [
"abc.com",
"test.com",
"hello.com"
],
"type": "CUST",
"customerId": 1
}
Request
POST http://localhost:8080/fpc/api/customers/1/domains
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"domainNames": [
"abc.com",
"xyz.com"
],
"customerId": 1
}
Response
Status 200 OK
Validation
If domain names are not unique, more than 10, or does not satisfy characters criteria, it will respond as Status 400 Bad
Request and with message as follows:
l {"domainNames": "Domain Name must be unique, xyz.com,def.com already exists"}
l {"domainNames": "Domain Name (xdfd23232!@#yzcom) is Invalid"}
l { "domainNames": "Domain Names count reached max limit of 10"}
GET example
Request
GET http://localhost:8080/fpc/api/customers/1/tabs
Headers
accept: application/json
content-type: application/json
fpc-sid: F08B913D590835973279E4F035C0DC03
Cookie: fpc-jsessionid=F08B913D590835973279E4F035C0DC03
Response
{
"id": 1,
"dashboard": true,
"view": true,
"wifi": false,
"reports": true,
"policy": true,
"objects": true,
"additionalResources": true,
"deviceManager": false,
"auditLogs": true,
"customerId": 1
}
Request
Headers
accept: application/json
content-type: application/json
fpc-sid: F08B913D590835973279E4F035C0DC03
Cookie: fpc-jsessionid=F08B913D590835973279E4F035C0DC03
Payload
{
"id": 1,
"dashboard": true,
"view": true,
"wifi": true,
"reports": true,
"policy": false,
"objects": true,
"additionalResources": true,
"deviceManager": true,
"auditLogs": true,
"customerId": 1
}
If Analytics is enabled dashboard, view and reports will always be true (even if it is set false in JSON payload it will
override) and vice-versa.
Response
Status 200 OK
GET example
Request
GET http://localhost:8080/fpc/api/customers/1/policytabs
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
{
"centralNat": false,
"interfacePolicy6": false,
"dosPolicy6": false,
"policy64": false,
"interfacePolicy": false,
"policy6": false,
"dosPolicy": true,
"policy46": false,
"id": 1,
"customerId": 1
}
Request
POST http://localhost:8080/fpc/api/customers/1/policytabs
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"centralNat": false,
"interfacePolicy6": false,
"dosPolicy6": false,
"policy64": false,
"interfacePolicy": false,
"policy6": false,
"dosPolicy": false,
"policy46": true,
"customerId": 1
}
Response
Status 200 OK
GET example
Request
GET http://localhost:8080/fpc/api/customers/1/policyobjects
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
{
"id": 1,
"customerId": 1,
"webfilter": false,
"applicationControl": false,
"antiSpam": false,
"dlp": false,
"firewallAddress": false,
"schedule": false,
"policyObjectWrite": false,
"ipsSensor": false,
"antivirus": false,
"user": false,
"userGroup": false,
"vip": false,
"localCategory": false,
"ratingOverrides": false,
"service": false
}
Request
POST http://localhost:8080/fpc/api/customers/1/policytabs
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"webfilter": true,
"applicationControl": false,
"antiSpam": false,
"dlp": false,
"firewallAddress": true,
"schedule": true,
"policyObjectWrite": true,
"ipsSensor": false,
"antivirus": false,
"user": false,
"userGroup": false,
"vip": false,
"localCategory": true,
"ratingOverrides": false,
"service": false
"customerId": 1
}
Response
Status 200 OK
GET example
Request
GET http://localhost:8080/fpc/api/customers/1/widgets
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
{
"widgetPermissionId" : 1,
"customerId" : 1,
"widgets" : [{
"widgetId" : 4,
"name" : "Top Application Category",
"uid" : "topAppCategory"
}, {
"widgetId" : 7,
"name" : "Top Web",
"uid" : "topWeb"
}
]
}
Request
POST http://localhost:8080/fpc/api/customers/1/widgets
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"customerId" : 1,
"widgets" : [{
"widgetId" : 4
}, {
"widgetId" : 7
}
]
}
Response
Status 200 OK
Widget
GET example
Request
GET http://localhost:8080/fpc/api/widgets/?type=CUST
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
[
{
"name": "Top Application Category",
"uid": "topAppCategory",
"widgetId": 4,
"type": "CUST"
},
{
"name": "Top Hostname By Traffic",
"uid": "topHNByTraffic",
"widgetId": 5,
"type": "CUST"
},
………..
…………
………….
{
"name": "Top Region By Traffic",
"uid": "topRegionByTraffic",
"widgetId": 6,
"type": "CUST"
}
]
GET example
Request
GET http://localhost:8080/fpc/api/customers/1/adoms
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
{
"id": 1,
"customerId": 1,
"adoms": [
"Forti/Adom4_Test",
"Forti/Adom3_Test"
]
}
Request
POST http://localhost:8080/fpc/api/customers/1/adoms
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"customerId": 1,
"adoms": [
"Forti/Adom1_Test",
"Forti/Adom4_Test",
"Forti/Adom3_Test"
]
}
Response
Status 200 OK
Request
GET http://localhost:8080/fpc/api/customers/2/installs?startdate=2016-11-14
12:38:08&enddate=2016-1Z1-24 15:38:08
Headers
accept: application/jsonz
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
Status 200 OK
[{
"id" : 3,
"taskId" : 681,
"customerId" : 2,
"customerName" : "customer two",
"userid" : 1,
"userName" : "system-generated",
"deviceName" : "FGVM010000051257",
"packageName" : "FGT168_LB_root",
"vdomName" : "root",
"taskDetails" : "Policy package FGT168_LB_root install to device FGVM010000051257and vdom
root started with taskId 681",
"adomName" : "Adom5_LB",
"fortimanagerId" : 1,
"createdOn" : 1479780232000
}, {
"id" : 4,
"taskId" : 682,
"customerId" : 2,
"customerName" : "customer two",
"userid" : 1,
"userName" : "system-generated",
"deviceName" : "FGVM010000051257",
"packageName" : "FGT168_LB_root",
"vdomName" : "root",
"taskDetails" : "Policy package FGT168_LB_root install to device FGVM010000051257and vdom
root started with taskId 682",
"adomName" : "Adom5_LB",
"fortimanagerId" : 1,
"createdOn" : 1479929677000
}]
Request
POST http://localhost:8080/fpc/api/customers/2/installs/4
Headers
accept: application/json
content-type: application/json
fpc-sid: $FPCSID
Cookie: fpc-jsessionid=$FPCSID
Response
Status 200 OK
{
"installId": 4,
"taskId": 682,
"customerId": 2,
"customerName": "customer two",
"installationLog": " Starting log (Run on device) Start installing FGVM010000051257 $
config vdom FGVM010000051257 (vdom) $ edit root current vf=root:0 FGVM010000051257
(root) $ config firewall policy FGVM010000051257 (policy) $ delete 21
FGVM010000051257 (policy) $ end FGVM010000051257 (root) $ end FGVM010000051257 $
config vdom FGVM010000051257 (vdom) $ edit root current vf=root:0 FGVM010000051257
(root) $ config firewall ssl-ssh-profile FGVM010000051257 (ssl-ssh-profile) $ delete
"_2_default_default_" FGVM010000051257 (ssl-ssh-profile) $ end FGVM010000051257
(root) $ end ---> generating verification report <--- done generating verification
report install finished ",
"errorCode": "0",
"errorMsg": "Get Install Log Successfully"
}
Request
Headers
Content-type: application/json
fpc-sid: $FPCSID”
Cookie: fpc-jsessionid=$FPCSID
Response
[
{
"customerId": 3,
"customerName": "abc",
"address1": "",
"address2": "",
"city": "",
"state": "",
"zip": "",
"phone": "",
"fax": "",
"contactFname": "abc",
"contactLname": "abc",
"contactEmail": "abc@abc.com",
"status": "A",
"totalStorage": 5,
"fpcStorage": 1,
"collectorStorage": 4,
"collectorStoragePercentage": 80,
"fpcStorageUsage": 0,
"collectorStorageUsage": 0,
"locale": "en",
"storageType": "GB",
"analyticsEnabled": "Y"
},
{
"customerId": 2,
"customerName": "Customer1",
"address1": "",
"address2": "",
"city": "",
"state": "",
"zip": "",
"phone": "",
"fax": "",
"contactFname": "Customer",
"contactLname": "one",
"contactEmail": "customer@customer.com",
"status": "A",
"totalStorage": 5,
"fpcStorage": 1,
"collectorStorage": 4,
"collectorStoragePercentage": 80,
"fpcStorageUsage": 8500,
"collectorStorageUsage": 0,
"deviceName": "tenant-2/fgt13/vd3,Adom4/FG_134/root,root/aaa/pravinvd",
"locale": "en",
"storageType": "GB",
"analyticsEnabled": "Y"
}
]
Status : 200 OK
FortiAnalyzer reports
Get unassigned FortiAnalyzer reports that the specified customer can assign
Request
GET http://localhost:8080/fpc/api/customers/1/availablefazreports
Headers
accept: application/json
content-type: application/json
fpc-sid: 9F6FDBC7A65806CFA2322CA525CF912F
Cookie: fpc-jsessionid=$FPCSID
Response
{
"ipAddress": null,
"reportName": "360-Degree Security Review",
"startTime": null,
"endTime": null,
"fazName": "FAZ_TEST",
"adom": "ADOM_TEST",
"reportId": 319,
"customerId": null,
"fazId": 3,
"customerName": null,
"devices": null
}
Request
GET http://localhost:8080/fpc/api/customers/2/assignedfazreports
Headers
accept: application/json
content-type: application/json
fpc-sid: 9F6FDBC7A65806CFA2322CA525CF912F
Cookie: fpc-jsessionid=$FPCSID
Response
{
"ipAddress": null,
"reportName": "360-Degree Security Review",
"startTime": null,
"endTime": null,
"fazName": "FAZ_TEST",
"adom": "ADOM_TEST",
"reportId": 319,
"customerId": 2,
"fazId": 3,
"customerName": TEST_customer,
"devices": null
}
Request
POST http://localhost:8080/fpc/api/customers/3/assignfazreports
Headers
accept: application/json
content-type: application/json
fpc-sid: 9F6FDBC7A65806CFA2322CA525CF912F
Cookie: fpc-jsessionid=$FPCSID
Payload
[319,303]
Response
Status 200 OK
Request
POST http://localhost:8080/fpc/api/customers/3/unassignfazreports
Headers
accept: application/json
content-type: application/json
fpc-sid: 9F6FDBC7A65806CFA2322CA525CF912F
Cookie: fpc-jsessionid=$FPCSID
Payload
[319,303]
Response
Status 200 OK
Request
GET http://localhost:8080/fpc/api/fortianalyzers
Headers
accept: application/json
content-type: application/json
fpc-sid: 5CE163D9F2D2C185843C77C6DE2DE2A4
Cookie: fpc-jsessionid=$FPCSID
Response
[{
"adminUserName": "boweiliu",
"fazVersion": null,
"name": "jad",
"ipAddress": "0.0.0.0",
"id": 1,
"status": "D"
},
{
"adminUserName": "admin",
"fazVersion": "v6.0.4-build0292 190109 (GA)",
"name": "FAZ",
"ipAddress": "10.106.6.214",
"id": 3,
"status": "A"
}
]
Request
GET http://localhost:8080/fpc/api/fortianalyzers/1
Headers
accept: application/json
content-type: application/json
fpc-sid: 5CE163D9F2D2C185843C77C6DE2DE2A4
Cookie: fpc-jsessionid=$FPCSID
Response
{
"id": 1,
"name": "Faz1",
"ipAddress": "10.106.6.214",
"adminUserName": "admin",
"status": "A",
"lastRunTime": 1553263143000,
"xmlPort": 8080,
"jsonPort": 443,
"fazVersion": "v6.0.4-build0292 190109 (GA)"
}
Request
POST http://localhost:8080/fpc/api/fortianalyzers
Headers
accept: application/json
content-type: application/json
fpc-sid: 5CE163D9F2D2C185843C77C6DE2DE2A4
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"name": "testRestAPI",
"ipAddress": "10.106.6.217",
"adminUserName": "admin",
"adminPassword": "admin123",
"jsonPort": 443,
}
Response
{
"fazId": 3
}
Request
POST http://localhost:8080/fpc/api/fortianalyzers/3
Headers
accept: application/json
content-type: application/json
fpc-sid: 5CE163D9F2D2C185843C77C6DE2DE2A4
Cookie: fpc-jsessionid=$FPCSID
Payload
{
"name": "testChangeNameRestAPI",
"ipAddress": "10.106.6.217",
"adminUserName": "admin",
"adminPassword": "admin123",
"jsonPort": 443
}
Response
Status 200 OK
Request
DELETE http://localhost:8080/fpc/api/fortianalyzers/3
Headers
accept: application/json
content-type: application/json
fpc-sid: 5CE163D9F2D2C185843C77C6DE2DE2A4
Cookie: fpc-jsessionid=$FPCSID
Response
Status 200 OK
Request
GET http://localhost:8080/fpc/api/fortianalyzers/3/pollnow
Headers
accept: application/json
content-type: application/json
fpc-sid: 5CE163D9F2D2C185843C77C6DE2DE2A4
Cookie: fpc-jsessionid=$FPCSID
Response
Status 200 OK
Request
GET http://localhost:8080/fpc/api/fortianalyzers/3/reporttemplates
Headers
accept: application/json
content-type: application/json
fpc-sid: 5CE163D9F2D2C185843C77C6DE2DE2A4
Cookie: fpc-jsessionid=$FPCSID
Response
[{
"fazId": null,
"reportName": "360-Degree Security Review",
"reportId": null,
"fazName": null,
"customerId": null,
"adom": "ADOM_FAZ_60X_60_FOR_CI",
"customerName": ""
},
{
"fazId": null,
"reportName": "Admin and System Events Report",
"reportId": null,
"fazName": null,
"customerId": null,
"adom": "ADOM_FAZ_60X_60_FOR_CI",
"customerName": ""
}
]
Request
Headers
accept: application/json
Content-type: application/json
fpc-sid: $FPCSID
Cookie: JSESSIONID=$FPCSID
Response
json
201 Created
Response Header:
Location: http://localhost/fpc/api/license
Content-Type: application/json;charset=UTF-8
Date: Tue, 12 Oct 2021 17:52:28 GMT
Content-Length: 87
Message Body
{
"location": "http://localhost/fpc/api/license",
"message": "license uploaded succefully"
}
License information
Get example
Request
GET http://localhost:8080/fpc/api/license
Headers
accept: application/json
Content-type: application/json
fpc-sid: $FPCSID
Cookie: JSESSIONID=$FPCSID
Response
{
"vmLicense": "valid",
"numberOfDevicesAllowed": "100 [5]",
"numberOfFAPDevicesAllowed": "1000 [0]",
"numberOfSandboxDevicesUsed": 0,
"expiryDate": "Sat Apr 07 21:40:29 2029 GMT",
"fpcSerialNumber": "FPC-VM7777778880"
}
Copyright© 2022 Fortinet, Inc. All rights reserved. Fortinet®, FortiGate®, FortiCare® and FortiGuard®, and certain other marks are registered trademarks of Fortinet, Inc., and other Fortinet names herein
may also be registered and/or common law trademarks of Fortinet. All other product or company names may be trademarks of their respective owners. Performance and other metrics contained herein were
attained in internal lab tests under ideal conditions, and actual performance and other results may vary. Network variables, different network environments and other conditions may affect performance
results. Nothing herein represents any binding commitment by Fortinet, and Fortinet disclaims all warranties, whether express or implied, except to the extent Fortinet enters a binding written contract,
signed by Fortinet’s General Counsel, with a purchaser that expressly warrants that the identified product will perform according to certain expressly-identified performance metrics and, in such event, only
the specific performance metrics expressly identified in such binding written contract shall be binding on Fortinet. For absolute clarity, any such warranty will be limited to performance in the same ideal
conditions as in Fortinet’s internal lab tests. Fortinet disclaims in full any covenants, representations, and guarantees pursuant hereto, whether express or implied. Fortinet reserves the right to change,
modify, transfer, or otherwise revise this publication without notice, and the most current version of the publication shall be applicable.