0% found this document useful (0 votes)
216 views61 pages

FortiPortal 7.2.4 REST API Guide

Uploaded by

mahdi1674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views61 pages

FortiPortal 7.2.4 REST API Guide

Uploaded by

mahdi1674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

REST API Guide

FortiPortal 7.2.4
FORTINET DOCUMENT LIBRARY
https://docs.fortinet.com

FORTINET VIDEO LIBRARY


https://video.fortinet.com

FORTINET BLOG
https://blog.fortinet.com

CUSTOMER SERVICE & SUPPORT


https://support.fortinet.com

FORTINET TRAINING & CERTIFICATION PROGRAM


https://www.fortinet.com/training-certification

FORTINET TRAINING INSTITUTE


https://training.fortinet.com

FORTIGUARD LABS
https://www.fortiguard.com

END USER LICENSE AGREEMENT


https://www.fortinet.com/doc/legal/EULA.pdf

FEEDBACK
Email: [email protected]

March 13, 2024


FortiPortal 7.2.4 REST API Guide
37-724-993339-20240313
TABLE OF CONTENTS

Change Log 5
Introduction 6
REST API background 6
Using the API 7
Accessing the API 7
Headers 7
URL parameters 7
JSON payload parameters 7
Success response structure 8
Failure response structure 8
Authentication 8
API HTTP response codes 9
API reference 10
Account 10
List all organizations 11
Get organization general info 12
Create a new organization 13
Delete organizations 14
Update general information for an organization 14
Get organization contact information 16
Update contact information for an organization 17
Get organization users 18
Create organization user 20
Update organization user 21
Delete organization users 23
Get profiles 23
Create a profile 24
Get installs 26
Get install 27
Device 28
List all ADOMs 28
Edit ADOMs assigned to an organization 30
Get report templates 31
Assign report templates 32
Unassign report templates from an organization 33
List all sites for an organization 33
List all sites for an organization in simple format 36
Get a site 38
Create a site 40
Edit a site 41
Delete site 43
Get VDOMs of an organization site 43
Get available VDOMs of an organization's site 46
Update a VDOM alias 50
System 51

FortiPortal 7.2.4 REST API Guide 3


Fortinet Inc.
Get all licenses 51
Upload a license 52
Appendix A - Access Permissions 53
Provider 53
Customer 55

FortiPortal 7.2.4 REST API Guide 4


Fortinet Inc.
Change Log

Date Change Description

2024-03-13 Initial release.

FortiPortal 7.2.4 REST API Guide 5


Fortinet Inc.
Introduction

This document provides information about the FortiPortal REST API.


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.
The FortiPortal REST API provides access to a subset of FortiPortal functionality.
For a browsable list of API calls, see the Fortinet Development Network (FNDN). A subscription is required to access the
FNDN.

REST API background

A RESTful API uses standard HTTP methods (GET, POST, DELETE, etc.) to provide interactions between a client and a
server. The API is stateless and 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 PATCH, PUT, or POST request.
4. Delete data by sending a DELETE request.

FortiPortal 7.2.4 REST API Guide 6


Fortinet Inc.
Using the API

This chapter provides details on accessing and authenticating the FortiPortal API.
See Accessing the API on page 7 and Authentication on page 8.

Accessing the API

Create HTTP requests in the following format:


https://<ipaddress>/fpc/v1/api/<resources>

Headers

Each request must contain the following HTTP header fields:


l Content-type: application/json
l Authorization: Token <API_key>
The Authorization header is mandatory in all API calls.
See Authentication on page 8 for more information.

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 organization sites), the URL may contain more than one
index (one for organization 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.

JSON payload parameters

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 lists the required and optional fields for each API method.

FortiPortal 7.2.4 REST API Guide 7


Fortinet Inc.
Using the API

Success response structure

API returns the following values in a successful response message:


l HTTP status 200
l Optionally, a JSON string depending on the API method.

Failure response structure

API returns the following values in a failure response message:


l HTTP status 4xx or 500
l A JSON string with the error details

Authentication

To initiate REST API requests, you must first log in to FortiPortal and acquire an API key.
The authorization key must be included in all subsequent API requests in the Authorization header. The key expires
in one hour.

To acquire an API key in the GUI:

1. Log in to FortiPortal as an administrator.


2. In the header, click the cog icon.
3. Click on API Key.
4. In the New API Key dialog, click Regenerate, then copy the API token .

Include the key in the API requests in this manner:


"-H "Authorization: Token <API_key>"

Acquiring a new key does not expire any other generated keys.

To acquire a token in the API:

Send a POST request to https://<ipaddress>/fpc/api/auth/tokenlogin/ with the following JSON payload:


{
"username": <username>,
"password": <password>,
"ttl_days": <days>,
"ttl_hours": <hours>,
"ttl_minutes": <minutes>
}

FortiPortal 7.2.4 REST API Guide 8


Fortinet Inc.
Using the API

Parameter Required Description

username Y Valid admin user name.

password Y Password for the admin user.

ttl_days N Length of time, in days, that the token is valid. Maximum 30.

ttl_hours N Length of time, in hours, that the token is valid. Maximum 23.

ttl_minutes N Length of time, in minutes, that the token is valid. Maximum 59.

JSON response:
{
"expiry": null,
"token": "138f1bc8865ba7659b86eff57533e90815406fdd1dd0d38f838100f469f2788d"
}

Parameter Description

expiry The token expiry in ISO-8601 format.


If no ttl values were provided, the token expires in 10 hours or when tokenlogout is called.

token API authorization token

To log out and delete the token:

Send a POST request to https://<ipaddress>/fpc/api/auth/tokenlogout/ with the token to be deleted in


the request Authorization header, as detailed in Accessing the API on page 7.
This returns a 204 No Content response.

API HTTP response codes

The API returns an HTTP status code to indicate the disposition of the request:

200 Status ok Request successful.

400 Bad request Bad request.

403 Forbidden Request is missing the CSRF token or administrator is missing access profile
permissions.

404 Not Found Unable to find the specified resource.

405 Method Not Allowed Specified HTTP method is not allowed for this resource.

413 Request Entity Too Request too large.


Large

424 Failed Dependency A required dependency was not found.

500 Internal Server Error Internal server error. Check the audit log for more information, if available.

FortiPortal 7.2.4 REST API Guide 9


Fortinet Inc.
API reference

This chapter provides details about each of the API methods. You must acquire a token from the FortiPortal GUI before
using the API methods.
See Authentication on page 8 for more information.

Account

Method Path Description

GET account/organizations/ List all organizations

GET account/organization/general/{Organization Get a specific organization


ID}/

POST account/organizations/ Create a new organization

DELETE account/organizations/group/ Delete the specified organizations

PATCH account/organization/general/{Organization Update an organization general information


ID}/

GET account/organization/contact/{Organization Get the contact information for an organization


ID}/

PATCH account/organization/contact/{Organization Update the contact information for an organization


ID}/

GET account/organization/users/ Get organization users

POST account/organization/users/ Create a new organization user

PATCH account/organization/users/{uid}/ Update an organization user

DELETE account/organization/users/group/ Delete the specified organization users

GET account/roles/ Get profiles

POST account/roles/ Create a profile

GET account/organizations/{Organization Get list of installs by date range


ID}/installs/?startdate={%Y-%m-%d
%H:%M:%S}&enddate={%Y-%m-%d
%H:%M:%S}

GET account/organizations//{Organization Get an install record


ID}/installs/{Install ID}/

FortiPortal 7.2.4 REST API Guide 10


Fortinet Inc.
API reference

List all organizations

Method URL Description Arguments Outputs

GET account/organizations/ List all organizations none JSON array

Arguments

None

Outputs

Parameter Type Description

results JSON array Array of organizations. One entry per organization, each record
contains a unique ID.

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" https://<ip_
address>/fpc/v1/api/account/organizations/

Example response

{
"data" : {
"results" : [
{
"adom_version_num" : [],
"device_count" : 0,
"id" : 1,
"name" : "TeSt2",
"reports" : {
"assigned" : 0,
"total" : 0
},
"site_count" : 0,
"status" : []
}
],
"totalResultsCount" : 1
},
"status" : {
"code" : 0,
"message" : "success"
}
}

FortiPortal 7.2.4 REST API Guide 11


Fortinet Inc.
API reference

Get organization general info

Method URL Description Arguments Outputs

GET account/organization/ Get general information for a Organization ID Organization record


general/{organization particular organization
ID}/

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

Outputs

Parameter Type Description

name string Name of the customer

first_name string First name of the contact person

last_name string Last name of the contact person

email string Email address of the contact person

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" "https://<ip_
address>/fpc/v1/api/account/organization/general/1/"

Example response

{
"blocked_host_enabled" : false,
"email" : "[email protected]",
"first_name" : "aaa",
"global_two_factor_enabled" : false,
"last_name" : "bbb",
"locale" : "en",
"logo_image" : null,
"name" : "TeSt2",
"policy_installation_scheduler" : null,
"policy_installation_time" : null,
"policy_installation_weekday" : null,
"sso_domains" : [],
"trusted_host_enabled" : false,
"use_mssp_locale" : false,
"validate_sso_domain_pattern" : false

FortiPortal 7.2.4 REST API Guide 12


Fortinet Inc.
API reference

Create a new organization

HTTP Method Path Description Arguments Outputs

POST account/organizations/ Create a new organization Organization New organization


record. values

Arguments (JSON payload)

Parameter Type Required Description

name string Y Organization name

first_name string N First name of the contact person

last_name string N Last name of the contact person

email string Y Organization contact email

Outputs

Parameter Type Description

id int Unique ID of the newly created organization

name string Organization name

first_name string First name of the contact person

last_name string Last name of the contact person

email string Organization contact email

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" -d '{"email":
"[email protected]", "first_name": "aaa", "last_name": "bbb", "name": "TeSt2"}' "https://<ip_
address>/fpc/v1/api/account/organizations/"

Example response

{
"email" : "[email protected]",
"first_name" : "aaa",
"id" : 1,
"last_name" : "bbb",
"name" : "TeSt2"

FortiPortal 7.2.4 REST API Guide 13


Fortinet Inc.
API reference

Delete organizations

Method URL Description Arguments Outputs

DELETE account/organizations/group/ Delete organizations organizations none

Arguments (JSON payload)

Parameter Type Description

organizations array An array of organization IDs

Outputs

None.

Example request

curl -k -X DELETE -H "Content-Type: application/json" -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" -d '{"organizations":
[2]}' "https://<ip_address>/fpc/v1/api/account/organizations/group/"

Update general information for an organization

Method URL Description Arguments Outputs

PATCH account/organization/general / Update general Organization ID Organization


{organization ID}/ information for an existing record
organization

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

FortiPortal 7.2.4 REST API Guide 14


Fortinet Inc.
API reference

Arguments (JSON payload)

Parameter Type Required Description

name string N Organization name

first_name string N First name of the contact person

last_name string N Last name of the contact person

email string N Organization contact email

Outputs

Parameter Type Description

name string Name of the customer

first_name string First name of the contact person

last_name string Last name of the contact person

email string Email address of the contact person

Example request

curl -k -X PATCH -H "Content-Type: application/json" -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" -d '
{"email":"[email protected]"}' "https://<ip_
address>/fpc/v1/api/account/organization/general/1/"

Example response

{
"blocked_host_enabled" : false,
"email" : "[email protected]",
"first_name" : "aaa",
"global_two_factor_enabled" : false,
"last_name" : "bbb",
"locale" : "en",
"logo_image" : null,
"name" : "TeSt2",
"policy_installation_scheduler" : null,
"policy_installation_time" : null,
"policy_installation_weekday" : null,
"sso_domains" : [],
"trusted_host_enabled" : false,
"use_mssp_locale" : false,
"validate_sso_domain_pattern" : false
}

FortiPortal 7.2.4 REST API Guide 15


Fortinet Inc.
API reference

Get organization contact information

Method URL Description Arguments Outputs

GET account/organization/contact/ Get contact information for Organization ID Organization


{Organization ID}/ a particular organization contact
information
record

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

Outputs

Parameter Type Description

name string Name of the customer

address_1 string Physical address line 1

address_2 string Physical address line 2

city string City

state string State or province

country string Country

zip string Zip or postal code

phone string Contact phone number

fax string Contact fax number

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6"
"https://localhost:9000/fpc/v1/api/account/organization/contact/1/"

Example response

{
"address1" : "",
"address2" : "",
"city" : "",
"country" : "",
"fax" : "",

FortiPortal 7.2.4 REST API Guide 16


Fortinet Inc.
API reference

"name" : "TeSt2",
"phone" : "",
"state" : "",
"zip" : ""
}

Update contact information for an organization

Method URL Description Arguments Outputs

PATCH account/organization/contact/ Update contact Organization ID Organization


{organization ID}/ information for an record
organization

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

Arguments (JSON payload)

Parameter Type Required Description

name string N Name of the customer

address_1 string N Physical address line 1

address_2 string N Physical address line 2

city string N City

state string N State or province

country string N Country

zip string N Zip or postal code

phone string N Contact phone number

fax string N Contact fax number

Outputs

Parameter Type Description

name string Name of the customer

address_1 string Physical address line 1

FortiPortal 7.2.4 REST API Guide 17


Fortinet Inc.
API reference

Parameter Type Description

address_2 string Physical address line 2

city string City

state string State or province

country string Country

zip string Zip or postal code

phone string Contact phone number

fax string Contact fax number

Example request

curl -k -X PATCH -H "Content-Type: application/json" -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" -d '{"name":"New
Name"}' "https://<ip_address>/fpc/v1/api/account/organization/contact/1/"

Example response

{
"address1" : "123",
"address2" : "",
"city" : "",
"country" : "",
"fax" : "",
"name" : "New Name",
"phone" : "",
"state" : "",
"zip" : ""
}

Get organization users

Method URL Description Arguments Outputs

GET account/organization/users/ List all users for a particular Organization JSON array
organization unique identifier

Arguments (JSON payload)

None

FortiPortal 7.2.4 REST API Guide 18


Fortinet Inc.
API reference

Outputs

Parameter Type Description

results JSON array Array of organization user records. One entry per organization user,
each record contains a unique user ID.

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" "https://<ip_
address>/fpc/v1/api/account/organization/users/"

Example response

{
"results" : [
{
"address1" : "",
"address2" : "",
"auth_backend" : "local",
"city" : "",
"country" : "",
"customer" : 1,
"email" : "[email protected]",
"fax" : "",
"first_name" : "Test",
"global_two_factor_enabled" : false,
"id" : 15,
"is_active" : true,
"last_name" : "User",
"phone" : "",
"pwdEnable" : false,
"pwdLength" : 8,
"pwdLowercase" : false,
"pwdNumbers" : false,
"pwdSpecialcharacters" : false,
"pwdUppercase" : false,
"role" : {
"id" : 2,
"name" : "Customer Admin",
"service_provider" : 1,
"service_type" : "Customer"
},
"service_provider" : 1,
"sites" : [
2
],
"state" : "",
"two_factor_enabled" : false,
"username" : "[email protected]",
"zip" : ""
}

FortiPortal 7.2.4 REST API Guide 19


Fortinet Inc.
API reference

],
"size" : 10,
"start" : 0,
"totalResultsCount" : 1
}

Create organization user

Method URL Description Arguments Outputs

POST account/organization/users/ Create a new organization Organization JSON array


user unique identifier

Arguments (JSON payload)

Parameter Type Description

service_provider int The service provider ID

customer int Organization id

username string The username of the new user

password string The password for the new user

confirmed_password string Confirm the password.

role int The ID of the role for the new user

two_factor_enabled bool Set to false. Users with two-factor authentication enabled cannot be
created through the API.

sites array An array of organization site IDs

Outputs

Parameter Type Description

user JSON array The new organization user record.

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


490f80823bf377e0b3e41476c0d576e448246be15b6b9d64f5c71a69daf24aee" -d '{"customer": "4",
"username": "another_test_user", "password": "12345", "confirmed_password": "12345",
"role": "2", "service_provider": 1, "sites": [2]}' "https://<ip_
address>/fpc/v1/api/account/organization/users/"

FortiPortal 7.2.4 REST API Guide 20


Fortinet Inc.
API reference

Example response

{
"address1" : "",
"address2" : "",
"auth_backend" : "local",
"city" : "",
"country" : "",
"customer" : 4,
"email" : "",
"fax" : "",
"first_name" : "",
"global_two_factor_enabled" : false,
"id" : 16,
"is_active" : true,
"last_name" : "",
"phone" : "",
"pwdEnable" : false,
"pwdLength" : 8,
"pwdLowercase" : false,
"pwdNumbers" : false,
"pwdSpecialcharacters" : false,
"pwdUppercase" : false,
"role" : 2,
"service_provider" : 1,
"sites" : [
2
],
"state" : "",
"two_factor_enabled" : false,
"username" : "another_test_user",
"zip" : ""
}

Update organization user

Method URL Description Arguments Outputs

PATCH account/organization/users/ Update an organization User ID JSON array


{uid}/ user

Arguments (URL)

Parameter Type Description

uid int The user ID

FortiPortal 7.2.4 REST API Guide 21


Fortinet Inc.
API reference

Arguments (JSON payload)

Parameter Type Description

service_provider int The service provider ID

customer int Organization id

username string The username of the new user

password string The password for the new user

confirmed_password string Confirm the password.

role int The ID of the role for the new user

sites array An array of organization site IDs

Outputs

Parameter Type Description

JSON array The new organization user record.

Example request

curl -k -X PATCH -H "Content-Type: application/json" -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" -d '{"phone": "555-
555-5555", "first_name": "Testing"}' "https://<ip_
address>/fpc/v1/api/account/organization/users/1/"

Example response

{
"address1" : "",
"address2" : "",
"auth_backend" : "local",
"city" : "",
"country" : "",
"customer" : 4,
"email" : "",
"fax" : "",
"first_name" : "Testing",
"global_two_factor_enabled" : false,
"id" : 1,
"is_active" : true,
"last_name" : "",
"phone" : "555-555-5555",
"pwdEnable" : false,
"pwdLength" : 8,
"pwdLowercase" : false,
"pwdNumbers" : false,
"pwdSpecialcharacters" : false,

FortiPortal 7.2.4 REST API Guide 22


Fortinet Inc.
API reference

"pwdUppercase" : false,
"role" : 2,
"service_provider" : 1,
"sites" : [
2
],
"state" : "",
"two_factor_enabled" : false,
"username" : "another_test_user",
"zip" : ""
}

Delete organization users

Method URL Description Arguments Outputs

DELETE account/organization/users/group/ Delete the specified users JSON array


organization users

Arguments

Parameter Type Description

users array An array of user IDs

Outputs

None.

Example request

curl -k -X DELETE -H "Content-Type: application/json" -H "Authorization: Token


490f80823bf377e0b3e41476c0d576e448246be15b6b9d64f5c71a69daf24aee" -d '{"users": [1]}'
"https://<ip_address>/fpc/v1/api/account/organization/users/group/""

Get profiles

Method URL Description Arguments Outputs

GET account/roles/ Get profiles None JSON array

Arguments

None

FortiPortal 7.2.4 REST API Guide 23


Fortinet Inc.
API reference

Outputs

Parameter Type Description

results JSON array An array of all profiles

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" https://<ip_
address>/fpc/v1/api/account/roles/

Example response

{
"results" : [
{
"create_type" : "Default",
"id" : 1,
"name" : "Admin",
"permissions" : [
2,
4,
7,
...
],
"service_provider" : 1,
"service_type" : "Provider"
},
...
}
],
"size" : 10,
"start" : 0,
"totalResultsCount" : 3
}

Create a profile

Method URL Description Arguments Outputs

POST account/roles/ Create a new profile None JSON array

Arguments (JSON payload)

Parameter Type Description

service_provider int The service provider ID

FortiPortal 7.2.4 REST API Guide 24


Fortinet Inc.
API reference

Parameter Type Description

name string The new profile name

service_type string The profile type (Provider or Customer)

permissions array A list of permission IDs

Outputs

Parameter Type Description

profile JSON array The new profile record

Permissions

For details about permission IDs, see Access Permissions on page 53.

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" -d '{"name":
"testtest", "service_type":"Provider", "service_provider": 1, "permissions": [1, 2,
3]}' https://<ip_address>/fpc/v1/api/account/roles/

Example response

{
"create_type" : "Custom",
"id" : 4,
"name" : "testtest",
"permissions" : [
1,
2,
3
],
"service_provider" : 1,
"service_type" : "Provider"
}

FortiPortal 7.2.4 REST API Guide 25


Fortinet Inc.
API reference

Get installs

Method URL Description Arguments Outputs

GET account/organizations/ Get list of installs by date l Organization ID JSON array


{Organization range l startdate
ID}/installs/?startdate= l enddate
{%Y-%m-%d
%H:%M:%S}&enddate=
{%Y-%m-%d %H:%M:%S}

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

Arguments (Query)

Parameter Type Description

startdate datetime The range start date and time in one of the following formats:
l %Y-%m-%d %H:%M:%S

l %Y-%m-%d %H:%M

enddate datetime The range end date and time in one of the following formats:
l %Y-%m-%d %H:%M:%S

l %Y-%m-%d %H:%M

Outputs

Parameter Type Description

results JSON array An array of install records

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" https://<ip_
address>/fpc/v1/api/account/organizations/1/installs?startdate=2023-07-
01%2000:00:00&enddate=2023-07-18%2014:34:00

FortiPortal 7.2.4 REST API Guide 26


Fortinet Inc.
API reference

Example response

[
{
"id": 1,
"task_id": 815,
"task_details": "Policy package FortiWiFi-61E-64-SDWAN-WiFi_root installed to device
FortiWiFi-61E-64-SDWAN-WiFi and vdom root started with taskId 815.",
"user_id": 2,
"user_name": "[email protected]",
"device_id": 187,
"device_name": "FortiWiFi-61E-64-SDWAN-WiFi",
"vdom_name": "root",
"package_name": "FortiWiFi-61E-64-SDWAN-WiFi_root",
"adom_name": "QALAB_ADOM_647_SDWAN_WiFi",
"fortimanager_id": 2,
"created_on": "2023-07-18T11:49:02.834010-07:00",
"customer_id": 1
}
]

Get install

Method URL Description Arguments Outputs

GET account/organizations/ Get an install record l Organization ID JSON object


{Organization l Install ID
ID}/installs/{Install ID}/

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

Install ID int ID of the install record

Outputs

Parameter Type Description

results JSON object An install record

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" https://<ip_
address>/fpc/v1/api/account/organizations/1/installs/1/

FortiPortal 7.2.4 REST API Guide 27


Fortinet Inc.
API reference

Example response

{
"install_id": 1,
"task_id": 815,
"customer_id": 1,
"customer_name": "test",
"installation_log": "\n\nStarting log (Run on device)\n\n\nStart installing\n\nNo
commands to be installed\n\ninstall finished\n",
"error_code": "0",
"error_msg": "Get Install Log Successfully"
}

Device

Method Path Description

GET device/adom/ List all ADOMs

GET device/report/ Get report templates

POST device/report/assign/ Assign report templates to an organization

POST device/report/unassign/ Unassign report templates

POST device/adom/customer/{Organization ID}/ Edit the ADOMs assigned to an organization

GET device/site/list/customer/{Organization ID}/ List all sites for an organization on page 33

GET device/site/customer/{Organization ID}/ List all sites for an organization in simple format on page
36

POST device/site/ Create a site

PUT device/site/{Site ID}/ Edit a site

DELETE device/site/group/ Delete sites

GET device/vdom/site/{Organization ID}/ Get all VDOMs of an organization

POST device/vdom/site/update_alias/ Update a VDOM alias

List all ADOMs

Method URL Description Arguments Outputs

GET device/adom/ List all ADOMs none JSON array

Arguments

None

FortiPortal 7.2.4 REST API Guide 28


Fortinet Inc.
API reference

Outputs

Parameter Type Description

results JSON array Array of ADOMs. One entry per ADOM, each record contains a
unique ID.

Example request

curl -k -X GET -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" https://<ip_
address>/fpc/v1/api/device/adom/

Example response

{
"data" : {
"results" : [
{
"customer" : [],
"flags" : "no_vpn_console",
"fortimanager" : {
"ha" : false,
"host" : "XXX.XXX.XXX.XXX",
"id" : 1,
"last_poll_time" : "2022-09-12T17:34:44.133713Z",
"name" : "FMG1",
"numericVersion" : "7.0.4",
"polling" : 50,
"port" : 443,
"sn" : "FMG-VMTMXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)",
"xmlPort" : 8080
},
"id" : 2,
"name" : "root",
"oid" : 3,
"version" : "7.0"
},
...
],
"totalResultsCount" : 2
},
"status" : {
"code" : 0,
"message" : "success"
}
}

FortiPortal 7.2.4 REST API Guide 29


Fortinet Inc.
API reference

Edit ADOMs assigned to an organization

Method URL Description Arguments Outputs

POST device/adom/customer/ Add or remove ADOMs Organization ID JSON array


{Organization ID}/ assigned to the specified
organization

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

Arguments (JSON payload)

Parameter Type Description

adoms array A list of ADOM IDs assigned to the organization. Include IDs to be
added, omit IDs to be removed.

Outputs

Parameter Type Description

status JSON array A success or failure message

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" -d '{"adoms":
[8,10,12]}' https://<ip_address>/fpc/v1/api/device/adom/customer/1/

Example response

{
"status" : {
"code" : 0,
"message" : "success"
}
}

FortiPortal 7.2.4 REST API Guide 30


Fortinet Inc.
API reference

Get report templates

Method URL Description Arguments Outputs

GET device/report/ Get report templates None JSON array

Arguments (URL)

None.

Outputs

Parameter Type Description

results JSON array Array of report templates. One entry per template, each record
contains a unique ID.

Example request

curl -k -X GET -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" https://<ip_
address>/fpc/v1/api/device/report/

Example response

{
"data" : {
"results" : [
{
"adom" : "FortiSandbox",
"customer" : [],
"fortianalyzer" : {
"host" : "XXX.XXX.XXX.XXX",
"id" : 1,
"last_poll_time" : "2022-09-12T21:31:45.259031Z",
"name" : "FPC-",
"numericVersion" : "7.0.4",
"polling" : 51,
"port" : 443,
"sn" : "FAZ-VMTMXXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)"
},
"id" : 1,
"name" : "FortiSandbox Default Report"
},
...
],
"totalResultsCount" : 73

FortiPortal 7.2.4 REST API Guide 31


Fortinet Inc.
API reference

},
"status" : {
"code" : 0,
"message" : "success"
}
}

Assign report templates

Method URL Description Arguments Outputs

POST device/report/assign/ Assign report templates None JSON array

Arguments (URL)

None.

Arguments

Parameter Type Description

customerId int The organization ID

reports array List of report IDs to assign to the organization

Outputs

Parameter Type Description

status JSON array A success or failure message

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" -d '
{"customerId":1,"reports":[297]}' "https://<ip_
address>/fpc/v1/api/device/report/assign/

Example response

{
"status" : {
"code" : 0,
"message" : "success"
}
}

FortiPortal 7.2.4 REST API Guide 32


Fortinet Inc.
API reference

Unassign report templates from an organization

Method URL Description Arguments Outputs

POST device/report/unassign Unassign report templates None JSON array

Arguments (URL)

None.

Arguments

Parameter Type Description

customerId int The organization ID

reports array List of report IDs to unassign from the organization

Outputs

Parameter Type Description

status JSON array A success or failure message

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" -d '
{"customerId":1,"reports":[297]}' "https://<ip_
address>/fpc/v1/api/device/report/unassign/

Example response

{
"status" : {
"code" : 0,
"message" : "success"
}
}

List all sites for an organization

Method URL Description Arguments Outputs

GET device/site/list/customer/ List all sites for this Organization ID JSON array
{Organization ID}/ organization

FortiPortal 7.2.4 REST API Guide 33


Fortinet Inc.
API reference

Arguments (URL)

Parameter Type Description

Organization ID int The organization ID.

Arguments (JSON payload)

None

Outputs

Parameter Type Description

results JSON array Array of site records. One entry per site, each record contains a
unique ID.

Example request

curl -k -X GET -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" https://<ip_
address>/fpc/v1/api/device/site/list/customer/10/

Example response

{
"data": {
"totalResultsCount": 1,
"results": [
{
"id": 6,
"vdoms": [
{
"id": 16,
"fortimanager": {
"id": 4,
"name": "FMG-7.2-11",
"host": "10.5.1.11",
"username": "fpc",
"status": true,
"last_poll_time": "2023-06-30T01:30:00.932838Z",
"port": 443,
"xmlPort": 8080,
"sn": "FMG-VMTMXXXXXXXX",
"version": "v7.2.3-build1405 230606 (GA)",
"numericVersion": "7.2.3",
"ha": false,
"polling": 51
},

FortiPortal 7.2.4 REST API Guide 34


Fortinet Inc.
API reference

"fortianalyzer": {
"id": 4,
"numericVersion": "7.2.3",
"name": "FAZ-7.2-31",
"host": "10.5.1.31",
"username": "fpc",
"status": true,
"last_poll_time": "2023-06-30T01:30:02.022982Z",
"port": 443,
"sn": "FAZ-VMTMXXXXXXXX",
"version": "v7.2.3-build1405 230606 (GA)",
"polling": 51
},
"adom": {
"id": 17,
"fortimanager": {
"id": 4,
"name": "FMG-7.2-11",
"host": "10.5.1.11",
"username": "fpc",
"status": true,
"last_poll_time": "2023-06-30T01:30:00.932838Z",
"port": 443,
"xmlPort": 8080,
"sn": "FMG-VMTMXXXXXXXX",
"version": "v7.2.3-build1405 230606 (GA)",
"numericVersion": "7.2.3",
"ha": false,
"polling": 51
},
"name": "root",
"oid": 3,
"version": "7.2",
"flags": "no_vpn_console",
"customer": [
10
]
},
"policypackage": {
"id": 20,
"name": "FGT-41",
"status": "imported",
"isEnable": true
},
"aps": [],
"switches": [],
"extenders": [],
"name": "root",
"sn": "FGVM08TMXXXXXXXX",
"devid": "FGT-41",
"alias": "",
"vdom_oid": 3,
"device_oid": 197,
"version": "7.2.5",
"platform": "FortiGate-VM64",
"status": "synchronized",

FortiPortal 7.2.4 REST API Guide 35


Fortinet Inc.
API reference

"device_ha": false,
"device_ha_info": "",
"latitude": 49.28273,
"longitude": -123.120743,
"fortigate_name": "FGT-41",
"display_name": "root/FGT-41/root",
"site": 6
}
],
"aps": [],
"switches": [],
"extenders: [],
"name": "test-site-7.2",
"contactName": "",
"email": "",
"phone": "",
"sandbox": false,
"customer": 10,
"user": [
12
]
}
]
},
"status": {
"code": 0,
"message": "success"
}
}

List all sites for an organization in simple format

Method URL Description Arguments Outputs

GET device/site/customer/{Organization List all sites for this Organization ID JSON array
ID}/ organization in simple
format

Arguments (URL)

Parameter Type Description

Organization ID int The organization ID.

Arguments (JSON payload)

None

FortiPortal 7.2.4 REST API Guide 36


Fortinet Inc.
API reference

Outputs

Parameter Type Description

results JSON array Array of site records. One entry per site, each record contains a
unique ID.

Example request

curl -k -X GET -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" https://<ip_
address>/fpc/v1/api/device/site/customer/10/

Example response

{
"data": {
"totalResultsCount": 2,
"results": [
{
"id": 6,
"name": "test-site-7.2",
"contactName": "",
"email": "",
"phone": "",
"sandbox": false,
"customer": 10,
"user": [
12
]
},
{
"id": 8,
"name": "test-site-7.4",
"contactName": "",
"email": "",
"phone": "",
"sandbox": false,
"customer": 10,
"user": [
12
]
}
]
},
"status": {
"code": 0,
"message": "success"
}
}

FortiPortal 7.2.4 REST API Guide 37


Fortinet Inc.
API reference

Get a site

Method URL Description Arguments Outputs

Get device/site/{SIte ID}/ Get a site SIte ID JSON array

Arguments (URL)

Parameter Type Description

Site ID int Site ID

Arguments (JSON payload)

None.

Outputs (site)

Parameter Type Description

site JSON array The site record

Example request

curl -k -X GET -H "Authorization: Token


f477c30a5810acc3583bad3f9517743830bae29a9ec06bb9309becdd5af3f503" https://<ip_
address>/fpc/v1/api/device/site/3/

Example response

{
"data" : {
"aps" : [],
"contactName" : "",
"customer" : 1,
"email" : "",
"extenders" : [],
"id" : 1,
"name" : "site1",
"phone" : "",
"sandbox" : false,
"switches" : [],
"user" : [],
"vdoms" : [
{
"adom" : {
"customer" : [

FortiPortal 7.2.4 REST API Guide 38


Fortinet Inc.
API reference

1
],
"flags" : "no_vpn_console",
"fortimanager" : {
"certificate_validation" : false,
"ha" : false,
"ha_vrrp" : false,
"ha_vrrp_primary_ip" : null,
"host" : "XXX.XXX.XXX.XXX",
"id" : 3,
"last_poll_time" : "2023-12-13T23:04:56.594250Z",
"name" : "FMG1",
"numericVersion" : "7.4.1",
"polling" : 52,
"port" : 443,
"selected_certificate" : null,
"sn" : "FMG-VMTMXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.4.1-build2308 230831 (GA)",
"xmlPort" : 8080
},
"id" : 7,
"name" : "72",
"oid" : 169,
"version" : "7.2"
},
"alias" : "",
"aps" : [],
"device_ha" : false,
"device_ha_info" : "",
"device_oid" : 165,
"devid" : "FPC-FGT1",
"display_name" : "72/FPC-FGT1/root",
"extenders" : [],
"fortianalyzer" : null,
"fortigate_name" : "FPC-FGT1",
"fortimanager" : {
"certificate_validation" : false,
"ha" : false,
"ha_vrrp" : false,
"ha_vrrp_primary_ip" : null,
"host" : "192.168.1.55",
"id" : 3,
"last_poll_time" : "2023-12-13T23:04:56.594250Z",
"name" : "FMG1",
"numericVersion" : "7.4.1",
"polling" : 52,
"port" : 443,
"selected_certificate" : null,
"sn" : "FMG-VMTMXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.4.1-build2308 230831 (GA)",
"xmlPort" : 8080
},

FortiPortal 7.2.4 REST API Guide 39


Fortinet Inc.
API reference

"id" : 1,
"latitude" : XXX,
"longitude" : XXX,
"name" : "root",
"platform" : "FortiGate-VM64-KVM",
"policypackage" : null,
"site" : 1,
"sn" : "FGVMULTMXXXXXXXX",
"status" : "modified",
"switches" : [],
"vdom_oid" : 3,
"version" : "7.2.6"
}
]
},
"status" : {
"code" : 0,
"message" : "success"
}
}

Create a site

Method URL Description Arguments Outputs

POST device/site/ Create a site JSON array

Arguments (URL)

None.

Arguments (JSON payload)

Parameter Type Required Description

customerId int Y The organization ID

name string Y The unique name for this site

contactName string N The primary contact name for this site

email email N The primary contact email for this site

phone phone N The primary contact phone number for


this site

sandbox bool N Enable or disable sandbox capability

switches array N A list of managed FortiSwitch IDs to


associate with this site

FortiPortal 7.2.4 REST API Guide 40


Fortinet Inc.
API reference

Parameter Type Required Description

vdoms array N A list of managed FortiManager IDs to


associate with this site

aps array N A list of managed FortiAP IDs to


associate with this site

Outputs

Parameter Type Description

status JSON array A success or failure message

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" -d '
{"name":"site3","contactName":"aaa","email":"[email protected]","phone":"","sandbox":false,"
vdoms":[54],"aps":[],"switches":[],"customerId":"1"}' "https://<ip_
address>/fpc/v1/api/device/site/

Example response

{
"status" : "success",
"id": 3,
"data": {
"id" : 3,
"vdoms" : []
"aps" : [],
"switches" : [],
"name" : "site3",
"contactName" : "aaa",
"email" : "[email protected]",
"phone" : "",
"sandbox" : false,
"customer" : 1,
"user" : [],
}
}

Edit a site

Method URL Description Arguments Outputs

POST device/site/{Site ID}/ Edit a site Site ID JSON array

FortiPortal 7.2.4 REST API Guide 41


Fortinet Inc.
API reference

Arguments (URL)

Parameter Type Description

Site ID int Site ID

Arguments (JSON payload)

Parameter Type Required Description

customerId int Y The organization ID

name string Y The unique name for this site

contactName string N The primary contact name for this site

email email N The primary contact email for this site

phone phone N The primary contact phone number for


this site

sandbox bool N Enable or disable sandbox capability

switches array N A list of managed FortiSwitch IDs to


associate with this site

vdoms array N A list of managed FortiManager IDs to


associate with this site

aps array N A list of managed FortiAP IDs to


associate with this site

Outputs

Parameter Type Description

results JSON array The site data.

Example request

curl -k -X PUT -H "Content-Type: application/json" -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" -d '
{"name":"site3","contactName":"aaa","email":"[email protected]","phone":"","sandbox":false,"
vdoms":[],"aps":[],"switches":[],"customerId":"1"}' "https://<ip_
address>/fpc/v1/api/device/site/4/"

Example response

{
"status" : {
"code" : 0,

FortiPortal 7.2.4 REST API Guide 42


Fortinet Inc.
API reference

"message" : "success"
}
}

Delete site

Method URL Description Arguments Outputs

DELETE device/site/group/ Delete sites None JSON array

Arguments (URL)

None

Arguments (JSON payload)

Parameter Type Description

sites array List of site IDs to delete

Outputs

None.

Example request

curl -k -X DELETE -H "Content-Type: application/json" -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" -d
'{"sites":[1, 2, 4]}' "https://<ip_address>/fpc/v1/api/device/site/group/"

Example response

{
}

Get VDOMs of an organization site

Method URL Description Arguments Outputs

GET device/vdom/site/ Get all VDOMs of an Site ID JSON array


{Site ID}/ organization site

FortiPortal 7.2.4 REST API Guide 43


Fortinet Inc.
API reference

Arguments (URL)

Parameter Type Description

Site ID int Site ID

Arguments (JSON payload)

None

Outputs

Parameter Type Description

results JSON array VDOM information for the specified organization site

Example request

curl -k -X GET -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" https://<ip_
address>/fpc/v1/api/device/vdom/site/3/

Example response

{
"data" : {
"results" : [
{
"adom" : {
"customer" : [
1
],
"flags" : "no_vpn_console",
"fortimanager" : {
"ha" : false,
"host" : "XXX.XXX.XXX.XXX",
"id" : 1,
"last_poll_time" : "2022-09-12T17:46:59.828879Z",
"name" : "FMG1",
"numericVersion" : "7.0.4",
"polling" : 51,
"port" : 443,
"sn" : "FMG-VMTMXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)",
"xmlPort" : 8080
},
"id" : 2,
"name" : "root",

FortiPortal 7.2.4 REST API Guide 44


Fortinet Inc.
API reference

"oid" : 3,
"version" : "7.0"
},
"alias" : "",
"device_ha" : false,
"device_ha_info" : "",
"device_oid" : 160,
"devid" : "FPC-FGT1",
"fortianalyzer" : null,
"fortigate_name" : "FPC-FGT1",
"fortimanager" : {
"ha" : false,
"host" : "XXX.XXX.XXX.XXX",
"id" : 1,
"last_poll_time" : "2022-09-12T17:46:59.828879Z",
"name" : "FMG1",
"numericVersion" : "7.0.4",
"polling" : 51,
"port" : 443,
"sn" : "FMG-VMTMXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)",
"xmlPort" : 8080
},
"id" : 1,
"latitude" : XX.XXXX,
"longitude" : XX.XXX,
"name" : "root",
"organization" : {
"id" : 1,
"name" : "Org1"
},
"platform" : "FortiGate-VM64-KVM",
"policypackage" : null,
"site" : 3,
"sn" : "FGVMXXXXXXXXXX",
"status" : "Synchronized",
"vdom_oid" : 3,
"version" : "7.0.6"
}
],
"totalResultsCount" : 1
},
"status" : {
"code" : 0,
"message" : "success"
}
}

FortiPortal 7.2.4 REST API Guide 45


Fortinet Inc.
API reference

Get available VDOMs of an organization's site

Method URL Description Arguments Outputs

GET device/vdom/site/available/?customerId= Get available Organization ID, JSON array


{Organization ID}&siteId={Site ID}/ VDOMs of an Site ID
organization's site

Arguments (URL)

Parameter Type Description

Organization ID int Organization ID

Site ID int Site ID

Arguments (JSON payload)

None

Outputs

Parameter Type Description

results JSON array An array of ADOMs.

Example request

curl -k -X GET -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" "https://<ip_
address>/fpc/v1/api/device/vdom/site/available/?customerId=1&siteId=1

Example response

{
"data" : {
"results" : [
{
"adom" : {
"customer" : [
1
],
"flags" : "no_vpn_console",
"fortimanager" : {
"ha" : false,

FortiPortal 7.2.4 REST API Guide 46


Fortinet Inc.
API reference

"host" : "XX.XX.XX.XX",
"id" : 1,
"last_poll_time" : "2023-01-10T18:53:30.475002Z",
"name" : "Org1 FMG",
"numericVersion" : "7.0.4",
"polling" : 51,
"port" : 443,
"sn" : "FMG-VMTMXXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)",
"xmlPort" : 8080
},
"id" : 3,
"name" : "root",
"oid" : 3,
"version" : "7.0"
},
"alias" : "",
"aps" : [],
"device_ha" : false,
"device_ha_info" : "",
"device_oid" : 185,
"devid" : "FPC-FGT1",
"display_name" : "root/FPC-FGT1/root",
"fortianalyzer" : null,
"fortigate_name" : "FPC-FGT1",
"fortimanager" : {
"ha" : false,
"host" : "XX.XX.XX.XX",
"id" : 1,
"last_poll_time" : "2023-01-10T18:53:30.475002Z",
"name" : "Org1 FMG",
"numericVersion" : "7.0.4",
"polling" : 51,
"port" : 443,
"sn" : "FMG-VMTMXXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)",
"xmlPort" : 8080
},
"id" : 1,
"latitude" : XX,
"longitude" : XX,
"name" : "root",
"platform" : "FortiGate-VM64-KVM",
"policypackage" : {
"id" : 2,

FortiPortal 7.2.4 REST API Guide 47


Fortinet Inc.
API reference

"isEnable" : false,
"name" : "FPC-FGT1",
"status" : "unknown"
},
"site" : 1,
"sn" : "FGVM01TMXXXXXXXX",
"status" : "modified",
"switches" : [
{
"alias" : "",
"display_name" : "root/FPC-FGT1/root",
"id" : 1,
"name" : "FSW",
"site" : 1,
"sn" : "S108ENXXXXXXXXX",
"vdom" : {
"adom" : {
"customer" : [
1
],
"flags" : "no_vpn_console",
"fortimanager" : {
"ha" : false,
"host" : "XX.XX.XX.XX",
"id" : 1,
"last_poll_time" : "2023-01-10T18:53:30.475002Z",
"name" : "Org1 FMG",
"numericVersion" : "7.0.4",
"polling" : 51,
"port" : 443,
"sn" : "FMG-VMTMXXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)",
"xmlPort" : 8080
},
"id" : 3,
"name" : "root",
"oid" : 3,
"version" : "7.0"
},
"alias" : "",
"device_ha" : false,
"device_ha_info" : "",
"device_oid" : 185,
"devid" : "FPC-FGT1",
"display_name" : "root/FPC-FGT1/root",
"fortianalyzer" : null,
"fortigate_name" : "FPC-FGT1",

FortiPortal 7.2.4 REST API Guide 48


Fortinet Inc.
API reference

"fortimanager" : {
"ha" : false,
"host" : "XX.XX.XX.XX",
"id" : 1,
"last_poll_time" : "2023-01-10T18:53:30.475002Z",
"name" : "Org1 FMG",
"numericVersion" : "7.0.4",
"polling" : 51,
"port" : 443,
"sn" : "FMG-VMTMXXXXXXXX",
"status" : true,
"username" : "fortiportal",
"version" : "v7.0.4-build0306 220608 (GA)",
"xmlPort" : 8080
},
"id" : 1,
"latitude" : XX,
"longitude" : XX,
"name" : "root",
"organization" : {
"id" : 1,
"name" : "Org1"
},
"platform" : "FortiGate-VM64-KVM",
"policypackage" : {
"id" : 2,
"isEnable" : false,
"name" : "FPC-FGT1",
"status" : "unknown"
},
"site" : 1,
"sn" : "FGVM01TMXXXXXXXX",
"status" : "Modified",
"vdom_oid" : 3,
"version" : "7.0.6"
}
}
],
"vdom_oid" : 3,
"version" : "7.0.6"
}
],
"totalResultsCount" : 1
},
"status" : {
"code" : 0,
"message" : "success"
}
}

FortiPortal 7.2.4 REST API Guide 49


Fortinet Inc.
API reference

Update a VDOM alias

Method URL Description Arguments Outputs

POST device/vdom/site/update_ Update a VDOM alias None JSON array


alias/

Arguments (URL)

None

Arguments (JSON payload)

Parameter Type Description

vdomId int VDOM ID

alias string The new VDOM alias

Outputs

Parameter Type Description

status JSON array A response message indicating success or failure.

Example request

curl -k -X POST -H "Content-Type: application/json" -H "Authorization: Token


7f89ef48dc5bca218a8ac0268653ffafa74ce6a6ed7a8a703e113b13219b18a6" -d '
{"vdomId":53,"alias":"vdom_alias"}' "https://<ip_
address>/fpc/v1/api/device/vdom/site/update_alias/"

Example response

{
"status" : {
"code" : 0,
"message" : "success"
}
}

FortiPortal 7.2.4 REST API Guide 50


Fortinet Inc.
API reference

System

Method Path Description

GET system/licenses/ Get all licenses

POST system/licenses/upload/ Upload a license

Get all licenses

Method URL Description Arguments Outputs

GET system/licenses/ List all licenses none JSON array

Arguments

None

Outputs

Parameter Type Description

JSON array Array of licenses. One entry per license, each record contains a
unique ID.

Example request

curl -k -X GET -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" https://<ip_
address>/fpc/v1/api/system/licenses/

Example response

[
{
"device_allowed" : 5000,
"expiry_date" : "2023-07-08T17:11:14Z",
"host" : "XXX.XXX.XXX.XXX",
"id" : 1,
"serial_number" : "FPC-VMTMXXXXXXX",
"status" : "valid"
}
]

FortiPortal 7.2.4 REST API Guide 51


Fortinet Inc.
API reference

Upload a license

Method URL Description Arguments Outputs

POST system/licenses/upload Upload a license JSON array

Arguments (URL)

None.

Arguments (form data)

Parameter Type Description

license file The license file

Outputs

None.

Example request

curl -k -H "Authorization: Token


9fb3fa217a23edbf50c8c358dab61beb07f6e8a191ecc597568f45e9455846e6" -F "license=@./FPC-
VMTM22000229.lic" -X POST https://<ip_address>/fpc/v1/api/system/licenses/upload/

Example response

{
}

FortiPortal 7.2.4 REST API Guide 52


Fortinet Inc.
Appendix A - Access Permissions

Appendix A - Access Permissions

The tables below list the permission IDs for each component.
Provider
Customer

Provider

Component Permission ID Permission

audit 15 Read/Write

audit 14 Read

dashboard 1 Read

dashboard 2 Read/Write

devices 8 CUSTOM

devices 7 Read/Write

devices 6 Read

devices: fortianalyzer 19 Read/Write

devices: fortianalyzer 18 Read

devices: fortimanager 17 Read/Write

devices: fortimanager 16 Read

notifications 13 Read/Write

notifications 12 Read

organizations 4 Read/Write

organizations 3 Read

organizations 5 CUSTOM

organizations: adoms 36 Read/Write

organizations: adoms 35 Read

organizations: authentication 41 Read

organizations: authentication 42 Read/Write

organizations: contact 34 Read/Write

organizations: contact 33 Read

FortiPortal 7.2.4 REST API Guide 53


Fortinet Inc.
Appendix A - Access Permissions

Component Permission ID Permission

organizations: general 32 Read/Write

organizations: general 31 Read

organizations: reports 43 Read

organizations: reports 44 Read/Write

organizations: sites 38 Read/Write

organizations: sites 37 Read

organizations: users 39 Read

organizations: users 40 Read/Write

system 10 Read/Write

system 9 Read

system 11 CUSTOM

system: additional_resources 30 Read/Write

system: additional_resources 29 Read

system: admins 26 Read/Write

system: admins 25 Read

system: profiles 24 Read/Write

system: profiles 23 Read

system: settings 22 CUSTOM

system: settings 21 Read/Write

system: settings 20 Read

system: settings: authentication 48 Read/Write

system: settings: authentication 47 Read

system: settings: blocked_hosts 50 Read/Write

system: settings: blocked_hosts 49 Read

system: settings: cluster 52 Read/Write

system: settings: cluster 51 Read

system: settings: email 53 Read

system: settings: email 54 Read/Write

system: settings: general 46 Read/Write

system: settings: general 45 Read

FortiPortal 7.2.4 REST API Guide 54


Fortinet Inc.
Appendix A - Access Permissions

Component Permission ID Permission

system: settings: other 55 Read

system: settings: other 56 Read/Write

system: theme 27 Read

system: theme 28 Read/Write

Customer

Component Permission ID Permission

additional_resources 77 Read/Write

additional_resources 76 Read

antivirus 203 Read/Write

antivirus 202 Read

customer_audit 75 Read/Write

customer_audit 74 Read

insights 57 Read

insights 58 Read/Write

insights 59 CUSTOM

insights: dashboard 78 Read

insights: dashboard 79 Read/Write

insights: health 82 Read

insights: health 83 Read/Write

insights: logs 84 Read

insights: logs 85 Read/Write

insights: logs 86 CUSTOM

insights: logs: application_control 207 Read/Write

insights: logs: application_control 206 Read

insights: logs: dns 205 Read/Write

insights: logs: dns 204 Read

insights: logs: event 210 Read

insights: logs: event 211 Read/Write

FortiPortal 7.2.4 REST API Guide 55


Fortinet Inc.
Appendix A - Access Permissions

Component Permission ID Permission

insights: logs: intrusion_prevention 199 Read/Write

insights: logs: intrusion_prevention 198 Read

insights: logs: sandbox 201 Read/Write

insights: logs: sandbox 200 Read

insights: logs: traffic 197 Read/Write

insights: logs: traffic 196 Read

insights: logs: web_filter 208 Read

insights: logs: web_filter 209 Read/Write

insights: monitor 80 Read

insights: monitor 81 Read/Write

reports 72 Read

reports 73 Read/Write

sdwan 62 CUSTOM

sdwan 60 Read

sdwan 61 Read/Write

sdwan: configuration 89 Read

sdwan: configuration 90 Read/Write

sdwan: dashboard 88 Read/Write

sdwan: dashboard 87 Read

security 63 Read

security 64 Read/Write

security 65 CUSTOM

security: network 99 CUSTOM

security: network 97 Read

security: network 98 Read/Write

security: network: certificate 217 Read/Write

security: network: certificate 216 Read

security: network: dhcp_server 195 Read/Write

security: network: dhcp_server 194 Read

security: network: ipsec_phase_1 188 Read

FortiPortal 7.2.4 REST API Guide 56


Fortinet Inc.
Appendix A - Access Permissions

Component Permission ID Permission

security: network: ipsec_phase_1 189 Read/Write

security: network: ipsec_phase_2 190 Read

security: network: ipsec_phase_2 191 Read/Write

security: network: static_route 193 Read/Write

security: network: static_route 192 Read

security: objects 95 Read/Write

security: objects 96 CUSTOM

security: objects 94 Read

security: objects: address 144 Read

security: objects: address 145 Read/Write

security: objects: antivirus_profile 156 Read

security: objects: antivirus_profile 157 Read/Write

security: objects: application_control 158 Read

security: objects: application_control 159 Read/Write

security: objects: file_filter_profile 162 Read

security: objects: file_filter_profile 163 Read/Write

security: objects: intrusion_prevention 164 Read

security: objects: intrusion_prevention 165 Read/Write

security: objects: local_category 168 Read

security: objects: local_category 169 Read/Write

security: objects: profile: group 219 Read/Write

security: objects: profile: group 218 Read

security: objects: rating_overrides 171 Read/Write

security: objects: rating_overrides 170 Read

security: objects: schedule 150 Read

security: objects: schedule 151 Read/Write

security: objects: service 152 Read

security: objects: service 153 Read/Write

security: objects: ssl: ssh: inspection 214 Read

security: objects: ssl: ssh: inspection 215 Read/Write

FortiPortal 7.2.4 REST API Guide 57


Fortinet Inc.
Appendix A - Access Permissions

Component Permission ID Permission

security: objects: user 178 Read

security: objects: user 179 Read/Write

security: objects: user_groups 180 Read

security: objects: user_groups 181 Read/Write

security: objects: video_filter 175 Read/Write

security: objects: video_filter 174 Read

security: objects: virtual_ip 154 Read

security: objects: virtual_ip 155 Read/Write

security: objects: web_filter_profile 167 Read/Write

security: objects: web_filter_profile 166 Read

security: policy 91 Read

security: policy 92 Read/Write

security: policy 93 CUSTOM

security: policy: authentication_policy 122 Read

security: policy: authentication_policy 123 Read/Write

security: policy: central_dnat 112 Read

security: policy: central_dnat 113 Read/Write

security: policy: central_snat 110 Read

security: policy: central_snat 111 Read/Write

security: policy: firewall_policy 143 Read/Write

security: policy: firewall_policy 142 Read

security: policy: ipv4_dos_policy 132 Read

security: policy: ipv4_dos_policy 133 Read/Write

security: policy: ipv4_interface_policy 137 Read/Write

security: policy: ipv4_interface_policy 136 Read

security: policy: ipv4_local_in_policy 128 Read

security: policy: ipv4_local_in_policy 129 Read/Write

security: policy: ipv4_multicast_policy 125 Read/Write

security: policy: ipv4_multicast_policy 124 Read

security: policy: ipv6_central_dnat 114 Read

FortiPortal 7.2.4 REST API Guide 58


Fortinet Inc.
Appendix A - Access Permissions

Component Permission ID Permission

security: policy: ipv6_central_dnat 115 Read/Write

security: policy: ipv6_dos_policy 135 Read/Write

security: policy: ipv6_dos_policy 134 Read

security: policy: ipv6_interface_policy 138 Read

security: policy: ipv6_interface_policy 139 Read/Write

security: policy: ipv6_local_in_policy 131 Read/Write

security: policy: ipv6_local_in_policy 130 Read

security: policy: ipv6_multicast_policy 127 Read/Write

security: policy: ipv6_multicast_policy 126 Read

security: policy: nat46_policy 119 Read/Write

security: policy: nat46_policy 118 Read

security: policy: nat64_policy 117 Read/Write

security: policy: nat64_policy 116 Read

security: policy: proxy_policy 120 Read

security: policy: proxy_policy 121 Read/Write

security: policy: security_policy 108 Read

security: policy: security_policy 109 Read/Write

security: policy: traffic_shaping_policy 141 Read/Write

security: policy: traffic_shaping_policy 140 Read

security: routing 212 Read

security: routing 213 Read/Write

switch 66 Read

switch 67 Read/Write

switch 68 CUSTOM

switch: configuration 102 Read

switch: configuration 103 Read/Write

switch: monitoring 100 Read

switch: monitoring 101 Read/Write

wifi 71 CUSTOM

wifi 70 Read/Write

FortiPortal 7.2.4 REST API Guide 59


Fortinet Inc.
Appendix A - Access Permissions

Component Permission ID Permission

wifi 69 Read

wifi: configuration 106 Read

wifi: configuration 107 Read/Write

wifi: monitoring 104 Read

wifi: monitoring 105 Read/Write

FortiPortal 7.2.4 REST API Guide 60


Fortinet Inc.
REST API Guide
FortiPortal 7.2.4

You might also like