Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Steaven_K
New Contributor

FML Rest API email address group

Hi,

 

I want to create an "email address group" using REST API.

I created "Group" but I do not know how to add "Member".

Thank you for your advice.

 

Thanks.

8 REPLIES 8
MartienssenL
New Contributor

Hi

 

did you get a solution ?

 

greetings

lars

Steaven_K

Hi,

 

I am still looking for documents.

I am contacting "Fortinet" but have not received an answer.

 

There are many other "API" to check.

 

Carl_Windsor_FTNT

>I am still looking for documents.

 

Did you find the FortiMail API Guide?

 

 

Dr. Carl Windsor Field Chief Technology Officer Fortinet

Steaven_K

Hi,

 

"email address group", "ip address group", and other commands were not found. This does not exist in the API documentation.

 

Thanks

MartienssenL

creating emailaddress group is working here with api/v1//ProfEmail_address_group/. But i cant add member to it.

 

greetings

lars

Frank1
New Contributor II

Hi,

 

We had the same question. It's not documented. Got this from Fortinet:

 

In the example bellow I am managing a group called grp for a domain a.com where I am handling a@a.com

 

**CREATE**

   curl -s -k -b cookie.txt -H 'Content-Type: application/json' -X POST -d ''  https://${FMLIP}/api/v1/Domain/a.com/ProfEmail_address_group/grp

 

**MODIFY Comment**

   curl -s -k -b cookie.txt -H 'Content-Type: application/json' -X POST -d '{"reqAction" : 5, "comment" : "mycomment"}'  https://${FMLIP}/api/v1/Domain/a.com/ProfEmail_address_group/grp

 

**LIST Content**

   curl -s -k -b cookie.txt -H "Content-Type: application/json" -X GET  https://${FMLIP}/api/v1/Domain/a.com/ProfEmail_address_group

   

   curl -s -k -b cookie.txt -H 'Content-Type: application/json' -X POST -d '{"reqAction" : "1", "parent_mkey" : "grp", "mdomain" : "a.com"}'  https://${FMLIP}/api/v1/ProfEmail_address_groupEmailAddressGroupMember

   

   curl -s -k -b cookie.txt -H 'Content-Type: application/json' -X POST -d '{"reqAction" : "1", "parent_mkey" : "grp" }'  https://${FMLIP}/api/v1/Domain/a.com/ProfEmail_address_groupEmailAddressGroupMemberCollection

 

**MODIFY Content**

ADD

   curl -s -k -b cookie.txt -H "Content-Type: application/json" -X POST https://${FMLIP}/api/v1/Domain/a.com/ProfEmail_address_group/grp/ProfEmail_address_groupEmailAddress...

DELETE

   curl -s -k -b cookie.txt -H "Content-Type: application/json" -X DELETE https://${FMLIP}/api/v1/Domain/a.com/ProfEmail_address_group/grp/ProfEmail_address_groupEmailAddress...

 

**DELETE

curl -s -k -b cookie.txt -H 'Content-Type: application/json' -X DELETE -d ''  https://${FMLIP}/api/v1/Domain/a.com/ProfEmail_address_group/grp

MartienssenL

thats it !

 

many thanks.

 

greetings

lars

emnoc
Esteemed Contributor III

Good Job  Frank, but I believe the modify actions should be PUT so a -X PUT in your above actions.

 

General rule of thumb 

 

http.request.method GET =  retrieve something if available

http.request.method DELETE =  delete something existing

http.request.method PUT =  modify something existing

http.request.method POST =  add something that does NOT exist

http.request.method OPTIONS = review what support options exist for that URL

 

Ken Felix

 

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
Labels
Top Kudoed Authors