I am trying to pull data from external api using guzzle http. Here is my code
$res = $client->request('GET', 'api/endpoint/');
$contents = $res->getBody()->getContents();
return $contents->slots; // THIS LINE GIVES ME ERROR. TRYING TO ACCESS THE SLOT. 
My data structure coming from api looks like this when I just return the $contents like this return $contents
I want to get access of slots. 
Anyone can help? Thank you,

