Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Create Group API does not work

Answered
New post

Comments

5 comments

  • mwiller

     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?

    0
    Comment actions Permalink
  • ClausBonde

    Hi 

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

    creategroup.PNG

     

    Thanks

    Claus

    0
    Comment actions Permalink
  • mwiller

     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?

    0
    Comment actions Permalink
  • ClausBonde

    Ah that makes sense.

    Now it works.

     

    Thanks a lot 🙂

     

    0
    Comment actions Permalink
  • bala33

    $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

    0
    Comment actions Permalink

Please sign in to leave a comment.