Getting "The request body was not well-formed." Error

I am trying to create multiple groups using curl. i amusing json input file to read the group names.

  curl -k -v -X POST -H "Accept: application/json" -H "Content-Type: **strong text**application/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!

We do not support creating multiple groups with a single request. You need to issue a request for each group.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.