Skip to main content
hanhan
New Member
June 23, 2025
Question

The API_Key used has no authorization

  • June 23, 2025
  • 4 replies
  • 940 views

coding using python to get the log in via API and process the data.. but the question is, when we use the API_Key from Forti, the content is empty, as if the API_Key used does not have authorization to get that Intrusion Prevention data. However, when I tried to use a cookie that was the result of intercepting the API.. there was a result

4 replies

Stephen_G
Staff & Editor
Staff & Editor
June 25, 2025

Hello hanhan,

 

Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.

 

In the meantime, if anyone else has any advice - feel free to provide it!

 

Thanks,

Stephen_G - Fortinet Community Team
Stephen_G
Staff & Editor
Staff & Editor
June 27, 2025

Hello,

 

We are still looking for an answer to your question.

 

We will come back to you ASAP.

In the meantime, if anyone else has any advice to contribute, please feel free to do so!

 

Thanks,

Stephen_G - Fortinet Community Team
Hatibi
Staff & Editor
Staff & Editor
July 1, 2025

Hello,

 

so you are using API to retrieve IPS data from FortiGate.

Can you check what response is the FortiGate providing upon getting the API request?

Maybe there is a need to use a different API endpoint when requesting data.


In FortiGate use the following debugs while you recreate the issue:

 

diagnose debug console timestamp enable
diagnose debug application httpsd -1
diagnose debug application nodejs -1
diagnose debug application flcfgd -1
diagnose debug application cu_acd -1
diagnose debug application fortilinkd -1
diagnose debug enable

 

This will give you more details on how FortiGate is responding to the request.

filiaks1
Explorer III
July 1, 2025
 

You can test with things like postman Insomnia and the Auth header should be with name "Authorization" and value "Bearer <API key>" and better see and test it with the test command for 7.6.3. If you see issues with the test commands and are not on 7.6.3 then :)

 

FortiGate REST API Authentication

 

Using APIs | FortiGate / FortiOS 7.6.3 | Fortinet Document Library

 

Screenshot 2025-07-01 171636.png"

 

 

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!