onOfficeGmbH / sdk

Official client for the onOffice API
https://apidoc.onoffice.de/
MIT License
9 stars 11 forks source link

Getting all images, that are used in long exposé? #33

Closed wemea closed 2 years ago

wemea commented 2 years ago

Hi,

I'm not sure if I'm able to ask questions here. If it's not allowed, delete / ignore this, please. My question is: I would like to get all images that are used in the long exposé via the API. Is it possible? I've read the whole documentation and couldn't find anything regarding to this. I tried the resource "idsfromrelation", but with this response I only get the image-ids of ALL images. Can you point me in the right direction? Thanks in advance.

Matze.

wemea commented 2 years ago

I found another solution.

marvinpoo commented 2 years ago

Yes it is possible. This is how we did it in a php solution:

public function getEstateImages($id, $categories){

         $parametersGetEstatePictures = [
             'estateids' => $id,
             'categories' => $categories
         ];

         $this->_handleRead = $this->_sdk->call(onOfficeSDK::ACTION_ID_GET, '','','estatepictures', $parametersGetEstatePictures);

         return $this->apiRequest();

     }

To make it technically more perfect, you could cache them in a CDN. This way you wouldn't have a heavy load of requests on OnOffice's servers and also could deliver the content quite faster to your users.

wemea commented 2 years ago

Thanks for your answer. Unfortunately this function only delivers the images that are assigned to the API. In my case there are only ten images delivered through the API (and I can display them, of course). But I want a function that displays all images that are used in the extended exposé (quite all, about thirty), without assigning them to the API. Do you know what I mean?

Thanks for the hint about caching. I already did that, but without a CDN. :)