Is there a reference somewhere to the error codes that the REST API responds with?
I am testing an API client we've built and I'd like to translate the negative integer values into something a little more meaningful, but there seems to be no documentation on errors other than the general HTTP status code 200, 404, 500, etc...
For example, if I create a new address group via API, but then try to create the same group name again, I get the following response:
HTTP/1.1 500 Internal Server Error
...other headers...
BODY contains:
{ "http_method":"POST", "revision":"c6ccf9fedb18ed33a43ee240a078b94c", "error":-5, "status":"error", "http_status":500, "vdom":"root", "path":"firewall", "name":"addrgrp", "serial":"FGTXXXXXXXXXXXXX", "version":"v6.2.1", "build":932 }
Here, I can only assume that the "-5" for "error" means duplicate entry exists, but there are other possible values we'd like to know what went wrong other than "-2" or something like it.
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
Good question. I think you need to ask support or run debug to gather more details.
e.g
diag debug app httpsd -1
Ken Felix
PCNSE
NSE
StrongSwan
Debug won't help really.
In order to properly develop a client, you need to know the error codes you COULD get. Not reverse engineer them when they happen.
This is because you would not know all the possible situations or errors that could happen. Imagine if the RFC for HTTP never published what "404" meant? People would just have to guess that it was "not found", and then wonder what a 403 means if it was rare. This is why they publish a document with all possible errors, and their meanings.
I would think FortiGate has something somewhere with this information.
Contact support and request the API reference, status and error codes. I 've never seen it published but the material that I have is approx 3 years old.
Also start at the FDN, link
https://www.fortinet.com/products/management/fortinet-developer-network-fndn.html
Ken Felix
PCNSE
NSE
StrongSwan
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1713 | |
1093 | |
752 | |
447 | |
231 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.