FortiAuthenticator
FortiAuthenticator provides access management and single sign on.
ggolubovic
Staff
Staff
Article Id 253854

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

 

rest_api failurerest_api failure

 

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"}

 

data.jsondata.json

 

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/

 

rest_api successrest_api success

Contributors