FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
WinterSnowYap
Article Id 382677
Description This article describes how to troubleshoot Linux show the message No permission for the resource when Linux curl FortiManager by using Rest API Administrator.
Scope FortiManager.
Solution

Below is the scenario:

  1. Linux uses the syntax below and gets a 'No permission for the resource' message.

 

curl -k --location 'https://X.X.X.X/jsonrpc' \ <----- X.X.X.X = FortiManager IP address.

--header 'Content-Type: text/plain' \

--data '{

    "method": "get",

    "params": [

        {

            "url": "/sys/status"

        }

    ],

    "id": 1

}'

 

202503_Linux Curl Postman_01.png

 

  1. At FortiManager, go to System Settings -> Administrators, edit Rest API Administrator, select Regenerate, and copy the New API Key.

 

202503_Linux Curl Postman_02.png

 

After that add the New API Key to curl information, and then Linux can curl it:

 

curl -k --location 'https://X.X.X.X/jsonrpc' \ <----- X.X.X.X = FortiManager IP address.

--header 'Content-Type: text/plain' \

--header 'Authorization: Bearer XXXXX ' \ <----- XXXXX = Copied New API Key.

--data '{

    "method": "get",

    "params": [

        {

            "url": "/sys/status"

        }

    ],

    "id": 1

}'

 

202503_Linux Curl Postman_03.png