API [FortiMail Browser Security only]

The FortiMail Browser Security API lets registered FortiMail Browser Security administrators perform various tasks that can otherwise be performed only using the FortiMail Browser Security console.

Important: This page describes the FortiMail Browser Security API. For details about the FortiMail Workspace Security API, see API [FortiMail Workspace Security].

This page includes the following topics:

FortiMail Browser Security API overview

The FortiMail Browser Security API lets you interact with the FortiMail Browser Security data. Only service accounts can use the FortiMail Browser Security API. Service accounts can use any programming language to run the FortiMail Browser Security API commands.

You can also use Swagger to interact with the FortiMail Browser Security API. Swagger's "Try it out" functionality lets you run and test the FortiMail Browser Security API commands. You can find the FortiMail Browser Security API in Swagger at the following location:

https://xray.abs.perception-point.io/api-docs

Note: The link to Swagger [above] is accessible after you sign-in to FortiMail Workspace Security. While you are signed-in to the FortiMail Browser Security console or FortiMail Workspace Security, no further authentication is required when using Swagger with the FortiMail Browser Security API.

API authentication

Authentication is required to run each FortiMail Browser Security API command. For authentication, a Bearer token is generated which must be appended to all API calls as the Authorization Header. When you use service accounts to run the FortiMail Browser Security API commands, you can use any programming language or environment to run the API commands. Service accounts use OAuth2 Client Credentials for authentication. For details, see API - Authentication for service accounts.

Constructing API commands [PowerShell]

When you use the FortiMail Browser Security API, you use the Invoke-RestMethod cmdlet to send the required HTTPS requests.

For example, the Invoke-RestMethod cmdlet below retrieves the personal user details of the currently logged-in user.

inherit
Invoke-RestMethod -Method Get -Uri "https://xray.abs.perception-point.io/api/profile" -Headers $Headers
  • For details, on the Invoke-RestMethod cmdlet, see the official Microsoft documentation here.

Parameters

-Method

Can be any one of the standard methods: Get, Post, Patch, or Delete.

See Swagger for the required method for each cmdlet.

-Uri

See Swagger for the required Uri for each cmdlet.

-Headers

For the required -Headers parameter, you can use $Headers values that you got from the authentication procedures. For an example, see Generating an access token using PowerShell [example].