Friday, October 19, 2018

Fortimail API access

In this post we will explore  a simple  API login and request for the fortinet fortimail


1st we need to  enable the rest-api function;


   config system global
      set rest-api enable
  end


By using  curl we can test the  API access

       curl  -k  -c  mycookies.txt -d '{ "name":"admin, "password":"apiadminpassword" } ' -X POST  -H  "Content-Type: application/json"   -v https://10.10.1.10/api/v1/AdminLogin/


       curl  -k  -b  mycookies.txt   -v https://10.10.1.10/api/v1/SysStatusSysinfo/ 



Here's the request  from my postman collection

https://www.getpostman.com/


And the headers for Content-Type




{
"name": "FMLapi",
"request": {
"url": "https://10.10.10.10/api/v1/AdminLogin/",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": "{ \"name\" : \"socpuppetsfml\" , \"password\" : \"myadminpassword\" }"
},
"description": ""
},
"response": []
}
]
}

for more information, use the fortinet  FortiMail API reference

https://docs.fortinet.com/uploaded/files/3416/FortiMail%20REST%20API%20Reference.pdf


FTNT
https://en.wikipedia.org/wiki/Fortinet







NSE ( network security expert) and Route/Switching Engineer
kfelix  -----a----t---- socpuppets ---dot---com
     ^      ^
=(  @  @ )=
         o

No comments:

Post a Comment