FortiCloud Products
FortiCloud Products
vinodhk
Staff
Staff
Article Id 336411
Description

This article describes how to view or download the FortiPresence Rest API.

Scope

FortiPresence, API.

Solution

FortiPresence REST API

The above-mentioned is the URL that can provide us the details about the APIs, which can be used against the FortiPresence.

 

The FortiPresence REST API (Application Program Interface) provides a set of HTTP-based RESTful APIs that allow FortiPresence customers to retrieve the same management dashboard and report functions that can be performed from its web-based GUI (Graphical User Interface).

 

The base URL is as follows:

Presence API 

 

All FortiPresence REST APIs require a valid access token which must be obtained through authentication. https://presenceapi.fortinet.com/auth/token by POST-ing account or user login credentials in JSON format.

 

Example:

 

curl -X POST -k 'https://presenceapi.fortinet.com/auth/token' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"username":"API User ID","password":"API User password"}'

 

As a reply to the above query, the token will be received.

https://support.fortinet.com/iam/#/users

 

The above URL is the place where the API users can be created and API userID and password will be generated for the API users automatically.

 

Select the username and use the 'Download credentials' button to download the 'API user ID” and “Password'.

Which can be used on the above-mentioned API Example to get the token.

 

Follow the below procedure.

  1. Access the URL FortiPresence REST API.
  2. Select the 'Authorize' button.
                                      
vinodhk_0-1724670819618.png

 

  1. The following window will be seen. Paste the token in the 'value' box in the following format.

Bearer token value:

 

Example: If the Token value is 'g4uiPFVTiLvUKuahIdDvhVB8xMb66w' then the format is as follows.

Bearer g4uiPFVTiLvUKuahIdDvhVB8xMb66w.

 

vinodhk_1-1724670819620.png

 

  1. After adding the token details under the value box, select the Authorize button.
  2. Once the specific user is authorized, select 'Presence APIs' under the 'Select a definition' option which can be seen on the right-hand side top.

 

vinodhk_2-1724670819621.png

 

  1. Users will land on the below page which will show the list of the APIs used for the FortiPresence.

 

vinodhk_3-1724670819625.png

 

  1. Select the down arrow key to get the description of the specific API and to get the 'Try it out' button to execute the specific API.