Enable the REST API
To use the REST API on FortiRecorder, it must be enabled and permissions granted for accounts that will use API access.
-
On FortiRecorder, either:
-
Use SSH to connect to the CLI.
-
Use a web browser to connect to the GUI, and then go to Dashboard > Console
-
-
Enter the following commands:
config system global
set rest-api enable
end
-
Enable HTTP and/or HTTPS on port1 or other network interfaces which you want to allow to receive REST API requests.
If you will use live video streams, also enable RTSP.
config system interface
edit port1
set allowaccess https ssh rtsp
end
-
Enable the REST API access mode for accounts that are allowed to use status and/or configuration URLs.
config system admin
edit YOUR_ACCOUNT
set access gui cli rest
end
Currently the REST API requires accounts with local password authentication. Remote authentication is not supported.
Accounts may not be allowed to use all of the URLs in the REST API, depending on permissions. Adjust them if needed. See administrator profiles in the FortiRecorder Administration Guide.
-
If you will use the REST API URLs for live video streams, or to download previously recorded video clips or snapshot images, enable those services.
config service video-stream
set status enable
set camera-groups YOUR_CAMERA_GROUP
set username YOUR_STREAM_USERNAME
set password YOUR_SERVICE_PASSWORD
set protocols https rtsp
end
config service video-clip
set status enable
set camera-groups YOUR_CAMERA_GROUP
set password YOUR_SERVICE_PASSWORD
end