pCloud/pcloud-sdk-php

getthumb endpoint failing in php

Opened this issue · 0 comments

Hi,

In Postman, I can use the getthumb endpoint no problem
https://eapi.pcloud.com/getthumb?fileid=xxx&size=500x500&crop=0&type=jpg

However in PHP, the getthumb endpoint fails because the Response Object doesn't have a 'results' property.

// my code
return $request->get("getthumb", [
    "fileid" => $fileId,
    "size" => "600x600",
    "crop" => 0
]);
// vendor/pcloud/pcloud-php-sdk/lib/Response.php
if ($this->response->result == 0) { <=== this is where it's failing
    return $this->parseResponse();
} else {

and returning the error

Attempt to read property "result" on string

I can't find a gethumb example in the PHP docs so I'm kind of shooting in the dark here. All I'm trying to do is show an <img> tag on a webpage of an image from my pCloud account - maybe there's a better way?