Fortinet white logo
Fortinet white logo

Curl examples

Curl examples

Caution

These Curl commands are for testing and development purposes only and should not be used in production. Always use secure, production-ready methods for API integration in a production environment.

Linux
Getting access token
curl -X POST https://fic.fortinet.com:9696/api/v1/login -H "Content-Type: application/json" -d "{\"client_id\": \"c8585630**************81b7485\", \"client_secret\": \"************************************Wl3w==\"}" 

Creating user with access token
curl -X POST "https://fic.fortinet.com:9696/api/v1/user" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <REDACTED_TOKEN>" \
  -d '{"username":"ftc_webapp_user_1","email":"***@gmail.com"}'

Windows Command Prompt
Getting access token
curl -X POST https://fic.fortinet.com:9696/api/v1/login -H "Content-Type: application/json" -d "{\"client_id\": \"c8585630-*************81b7485\", \"client_secret\": \"************************************Wl3w==\"}"

Creating user with access token
curl -X POST https://fic.fortinet.com:9696/api/v1/user -H "Content-Type: application/json" -H "Authorization: Bearer eyJ0e************************************1YF1kQ" -d "{\"username\": \"ftc_webapp_user_2\", \"email\": \"***@gmail.com\"}" 

Curl examples

Curl examples

Caution

These Curl commands are for testing and development purposes only and should not be used in production. Always use secure, production-ready methods for API integration in a production environment.

Linux
Getting access token
curl -X POST https://fic.fortinet.com:9696/api/v1/login -H "Content-Type: application/json" -d "{\"client_id\": \"c8585630**************81b7485\", \"client_secret\": \"************************************Wl3w==\"}" 

Creating user with access token
curl -X POST "https://fic.fortinet.com:9696/api/v1/user" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <REDACTED_TOKEN>" \
  -d '{"username":"ftc_webapp_user_1","email":"***@gmail.com"}'

Windows Command Prompt
Getting access token
curl -X POST https://fic.fortinet.com:9696/api/v1/login -H "Content-Type: application/json" -d "{\"client_id\": \"c8585630-*************81b7485\", \"client_secret\": \"************************************Wl3w==\"}"

Creating user with access token
curl -X POST https://fic.fortinet.com:9696/api/v1/user -H "Content-Type: application/json" -H "Authorization: Bearer eyJ0e************************************1YF1kQ" -d "{\"username\": \"ftc_webapp_user_2\", \"email\": \"***@gmail.com\"}"