Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
hanhan
New Contributor

The API_Key used has no authorization

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 4
Stephen_G
Moderator
Moderator

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 - Fortinet Community Team
Stephen_G
Moderator
Moderator

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 - Fortinet Community Team
Hatibi
Staff & Editor
Staff & Editor

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
Contributor II

 

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"

 

 

Announcements
Check out our Community Chatter Blog! Click here to get involved
Labels
Top Kudoed Authors