Hello,
Im trying to add the user: "user" to the group: "group1" using the api v2 of a fortigate v6.4.15
Below is my request with the return (200:OK) but no revision_change, so its doing nothing
Also below the GET requests on the user and group1 to show the configs
What am I missing ?
Thanks for reading !
curl -k -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer abcdefg" -d '{"member": "test"}' https://FORTI-URL/api/v2/cmdb/user/group/group1
{
"http_method":"PUT",
"revision":"5d01f6d0438463b2da7bd48c54508be3",
"revision_changed":false,
"mkey":"group1",
"status":"success",
"http_status":200,
"vdom":"root",
"path":"user",
"name":"group",
"serial":"FGT6xx",
"version":"v6.4.15",
"build":2095
}
curl -k -X GET -H "Content-Type: application/json" -H "Authorization: Bearer abcdefg" https://FORTI-URL/api/v2/cmdb/user/local/test
{
"http_method":"GET",
"revision":"5380e9e62a96d94149368f7c05789ab7",
"results":[
{
"name":"test",
"q_origin_key":"test",
"id":16777277,
"status":"enable",
"type":"password",
"passwd":"ENC XXXX",
"ldap-server":"",
"radius-server":"",
"tacacs+-server":"",
"two-factor":"disable",
"two-factor-authentication":"",
"two-factor-notification":"",
"fortitoken":"",
"email-to":"",
"sms-server":"fortiguard",
"sms-custom-server":"",
"sms-phone":"",
"passwd-policy":"",
"passwd-time":"2024-03-06 13:31:01",
"authtimeout":0,
"workstation":"",
"auth-concurrent-override":"disable",
"auth-concurrent-value":0,
"ppk-secret":"",
"ppk-identity":"",
"username-sensitivity":"enable"
}
],
"vdom":"root",
"path":"user",
"name":"local",
"mkey":"test",
"status":"success",
"http_status":200,
"serial":"FGT6xx",
"version":"v6.4.15",
"build":2095
}
curl -k -X GET -H "Content-Type: application/json" -H "Authorization: Bearer abcdefg" https://FORTI-URL/api/v2/cmdb/user/group/group1
{
"http_method":"GET",
"revision":"5d01f6d0438463b2da7bd48c54508be3",
"results":[
{
"name":"group1",
"q_origin_key":"group1",
"id":48,
"group-type":"firewall",
"authtimeout":0,
"auth-concurrent-override":"disable",
"auth-concurrent-value":0,
"http-digest-realm":"",
"sso-attribute-value":"",
"member":[
],
"match":[
],
"user-id":"email",
"password":"auto-generate",
"user-name":"disable",
"sponsor":"optional",
"company":"optional",
"email":"enable",
"mobile-phone":"disable",
"sms-server":"fortiguard",
"sms-custom-server":"",
"expire-type":"immediately",
"expire":14400,
"max-accounts":0,
"multiple-guest-add":"disable",
"guest":[
]
}
],
"vdom":"root",
"path":"user",
"name":"group",
"mkey":"group1",
"status":"success",
"http_status":200,
"serial":"FGT6xx",
"version":"v6.4.15",
"build":2095
}
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.
Hello @Nea ,
I think you need to add a "name" parameter in your request. Could you try this? I tried it in my lab. It works.
{
"member": [
{
"name": "xxx_user_name"
}
]
}
}
Hello @Nea ,
I think you need to add a "name" parameter in your request. Could you try this? I tried it in my lab. It works.
{
"member": [
{
"name": "xxx_user_name"
}
]
}
}
That's it !
Thank's a lot for your help and reactivity
Created on 10-18-2024 04:13 AM Edited on 10-18-2024 06:28 AM
Super
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 |
---|---|
1714 | |
1093 | |
752 | |
447 | |
232 |
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.