curl -X POST \
https://1.2.3.4.5/jsonrpc \
-H 'Accept: application/json' \
-H 'cache-control: no-cache' \
-k \
-H 'content-type: application/json' \
-H 'postman-token: 593987-1324' \
-d '{
"method": "exec",
"params": [{
"url": "/sys/login/user/",
"data": [{
"user":"username",
"passwd":"PASS"
}]
}],
"session":"1111111111111",
"id": 1,
"ver": "2.0"
}'
if [[ $? -eq 0 ]]; then
echo "API call successful. Response:"
else
echo "API call failed."
fi
I keep receiving an Invalid Request Response "code" 10 in the API response. Does anyone have any suggestions? Some of the other API requests such as the session request work fine so it leads me to believe there is some issue with the given parameters in the request. Any help would be greatly appreciated. Thank you.
Solved! Go to Solution.
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.
If you're getting an "Invalid Request" response:
"user"
and "passwd"
values are correct."ver": "2.0"
) is supported.Postman
or Insomnia
for easier debugging.If you're getting an "Invalid Request" response:
"user"
and "passwd"
values are correct."ver": "2.0"
) is supported.Postman
or Insomnia
for easier debugging.Thank you for your advice it was indeed a structural error with the JSON parameters just needed to step through it error by error.
Thank you again for all of your suggestions.
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 |
---|---|
1560 | |
1034 | |
749 | |
443 | |
210 |
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.