AnsweredAssumed Answered

Batch add students to a group

Question asked by Bahman Yaghoubi Vije on Feb 5, 2018
Latest reply on Feb 5, 2018 by Bahman Yaghoubi Vije

I want to add multiple students to a group using api request. 

The documentation indicated that the type of the request should be put, and the url would be: 

/api/v1/groups/:group_id
This works well when I add only one student, but doesn't work for multiple students. 

I am using Laravel framework and Guzzle as the client. Here is the method that I am using: 

 

public static function getResponse(string $type, string $url, array $form_params)
{
   $client = new Client;

   $response = $client->$type($url, [
      'headers' => [
         'Authorization' => 'Bearer ' . env('API_KEY'),
      ],
      'form_params' => $form_params
   ]);

   return $response;
}

Outcomes