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:
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 }'
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 }'
|