laravel-microsoft-graph icon indicating copy to clipboard operation
laravel-microsoft-graph copied to clipboard

Posting to /users/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/onlineMeetings returns string

Open ShaunWilders opened this issue 1 year ago • 1 comments

When trying to create a Teams meeting, it works, but the returned JSON is a string so the following error is generated...

Dcblogdev\MsGraph\MsGraphAdmin::isJson(): Argument #1 ($data) must be of type object, string given, called in C:\xampp\htdocs\magna\vendor\dcblogdev\laravel-microsoft-graph\src\MsGraphAdmin.php on line 189

Code in use...

$graphresponse = MsGraphAdmin::post("/users/". config('msgraph.MeetingUserId') ."/onlineMeetings", [
            'subject' => $booking->subject,
            'startDateTime' => $booking->start_time,
            'endDateTime' => $booking->end_time,
        ]);

Is there a reason for line 165 being specified as an object?

If I take out "object" it all works fine...

protected function isJson(/*object*/ $data): bool

ShaunWilders avatar Mar 21 '24 16:03 ShaunWilders

Same with get to user/

It makes absolutely no sense to have this typed as object given the contents of the function

boskee avatar Apr 03 '24 14:04 boskee