I am trying to create multiple groups using curl. i am using json input file to read the group names using:-
curl -k -v -X POST -H “Accept: application/json” -H “Content-Type: strong textapplication/json” -H “Authorization: SSWS xxxxxxxx” -d “@group.json”
“https://mytesturl.com/api/v1/groups”
my group.json file is as below but i’ m getting “errorSummary”:“The request body was not well-formed.”
{
“profile”: [{
“name”: “testgroup1”,
“description”: “testgroup1”
},
{
“name”: “testgroup2”,
“description”: “testgroup2”
},
{
“name”: “testgroup3”,
“description”: “testgroup3”
},
{
“name”: “testgroup4”,
“description”: “testgroup4”
}]
}
The same command works fine if i just have one key value
{
“profile”: {
“name”: “testgroup1”,
“description”: “testgroup1”
}
}
What should i do to have curl to process multiple entries in my json file to create multiple groups? Many Thanks!