lundi 19 février 2018

New announcement in Google classroom

I would like an example code for creating a new announcement in Google classroom using PHP in Laravel

I have tried the following code:

session_start();
    if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
        $this->client->setAccessToken($_SESSION['access_token']);
        $service = new \Google_Service_Classroom($this->client);
        $optParams = array(
            'courseId'=> '11091540235',
            'text' => 'help me'
        );
        $results = $service->courses_announcements->create($optParams);
        dump($results);

The error i get is missing postBody, but what should I be entering for the postBody?

Many Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire