Description
This article describes an issue that occurs when trying to access the FortiAuthenticator REST API through cURL on Windows. A workaround is provided.
Scope
FortiAuthenticator, any Windows operating system.
Solution
Upon using cURL on a Windows system to access the FortiAuthenticator REST API as per the REST API Solution Guide, the attempt may fail with the error 'Sorry, this request could not be processed. Please try again later.'
For example, with the following cURL expression for local user creation...
# curl -k -v -u "admin:IXL2hlahpwgTjwzVdXUR8Xd9v5NXTWCArsiR78Jl" -X POST -d '{"username":"rapi","password":"testpass","email":"test_userapi@fortiad.net","mobile_number":"+44-1234567890"}' -H "Content-Type: application//json" https://192.168.12.100/api/v1/localusers/
... the following output appears:
{"error_message": "Sorry, this request could not be processed. Please try again later."}* Connection #0 to host 192.168.12.100 left intact
To work around this behavior, place the HTTP POST data in a file and reference that file in the cURL POST command. For example, create a file named data.json containing the following:
{"username":"rapi","password":"testpass","email":"test_userapi@fortiad.net","mobile_number":"+44-1234567890"}
A valid curl expression for local user creation will look like this:
# curl -k -v -u "admin:IXL2hlahpwgTjwzVdXUR8Xd9v5NXTWCArsiR78Jl" -X POST -d @data.json -H "Content-Type: application/json" https://192.168.12.100/api/v1/localusers/
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.