Technical Tip: How to generate API Authorization token for FortiWeb
Description | This article describes how to generate an API authorization token to access FortiWeb via the REST API. |
Scope | FortiWeb v7.2 and later. |
Solution | Overview: Unlike FortiGate, FortiWeb does not support dedicated API users. Instead, API authentication is performed using a Base64-encoded authorization token derived from administrator credentials.   Authentication method: To authenticate API requests to FortiWeb, must generate an Authorization header using Base64 encoding of the following JSON structure:   Note: Replace user, pwd, and root with actual credentials and VDOM as required. Steps to Generate an Authorization Token  Step 1: Prepare JSON Payload:  Step 2: Encode using Base64. Encode the string using Linux, macOS, or online tools.  Linux / macOS Command:  Or use Base64 Encode and Decode - Online on a Windows machine.  Example Output:  ![]()
Include the encoded value in the Authorization header when making API calls. Â Sample API call: Â |

