Skip to main content
Question

Create Group API does not work

  • May 22, 2025
  • 5 replies
  • 39 views

Forum|alt.badge.img

Hi

When using the Create Group API I get this message:

{
"type": "error",
"status": 400,
"code": "bad_request",
"context_info":{
"errors":[
{
"reason": "missing_parameter",
"name": "group_tag_name",
"message": "'group_tag_name' is required"
}
]
},
"message": "Bad Request",
"request_id": "qxadlxfp2c3kaqfg"
}
 
Group_tag_name is not listed as a required parameter in the API documentation. It is not listed as a paramter at all. Adding the the parameter to the API call does not make any change.
Any ideas how to get around this?
 
best regards
Claus

5 replies

Forum|alt.badge.img

 Can you share more about the specific request you made?  I believe that `group_tag_name` refers to the `name` parameter for the Create Group API endpoint — how did you provide the name parameter?


Forum|alt.badge.img

Hi 

I used the R Client API tester with the input as below:

BOX_2bu899d6qvhgquuf4cv3bjsieu2b77zn.png

 

Thanks

Claus


Forum|alt.badge.img

 Ahh, I see the problem — per the Create Group API documentation, the name is a body parameter, not a query string parameter.  You'll need to move that into the POST body as JSON, e.g.

 

{"name": "Beer"}

Does that work for you?


Forum|alt.badge.img

Ah that makes sense.

Now it works.

 

Thanks a lot 🙂

 


Forum|alt.badge.img

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.box.com/2.0/groups'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"name\": \"Box Employees\", \"provenance\": \"Google\", \"external_sync_identifier\": \"Google-Box-Users\", \"description\": \"All box Users\", \"invitability_level\": \"admins_and_members\", \"member_viewability_level\": \"admins_only\"}"); $headers = array(); $headers[] = 'Authorization: Bearer Em90kUhK96fiAlTTqNEPrb9tJEI4GntE'; $headers[] = 'Content-Type: application/x-www-form-urlencoded'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close($ch);

 

 

its show empty result on curl function