1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Need REST WCF Query to get Image Content based on Image Library Name

Need REST WCF Query to get Image Content based on Image Library Name

4 posts, 1 answered
  1. Santosh
    Santosh avatar
    0 posts
    Registered:
    12 May 2017
    01 Jun
    Link to this post

    I'm trying to get images from Images library using ImageService.svc  with ajax call using jquery.  This gives me all the images libraries content. I have created a images library called "Banner Images". I want to get images only from that library. Following query gives me images from all the libraries.

     

    ~Sitefinity/Services/Content/ImageService.svc/

     

    How to apply filter to this? Something like below will help me ( Replace {filter} in the below query to get specific image library images)

     

    ~Sitefinity/Services/Content/ImageService.svc/?filter={filter}

     

    Any help on this is highly appreciated.

     

    Thanks,

    Santosh

  2. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    01 Jun in reply to Santosh
    Link to this post

    Hi Santosh,

    If you want to receive images under specific library, you need to do request like that (change guid with guid of your "Banner Images" library):

    /Sitefinity/Services/Content/ImageService.svc/parent/f4700cfd-f44c-4591-8369-540b1c0674cf/?managerType=&providerName=OpenAccessDataProvider&itemType=Telerik.Sitefinity.Libraries.Model.Image&provider=OpenAccessDataProvider&sortExpression=Ordinal%20ASC,%20LastModified%20DESC&skip=0&take=50

    Answered
  3. Santosh
    Santosh avatar
    0 posts
    Registered:
    12 May 2017
    07 Jun
    Link to this post

    Hi Victor,

     

    This gets images with default fields under specific library but it is not getting any of the custom fields created by me in the library.

     

    Is there is any workaround for this?

     

    Thanks,

    Santosh

  4. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    09 Jun in reply to Santosh
    Link to this post

    I know only one method, you need to call api for each image

    /Sitefinity/Services/Content/ImageService.svc/parent/032e4668-5b7e-6884-89b2-ff000089dfbc/062e4668-5b7e-6884-89b2-ff000089dfbc/?itemType=Telerik.Sitefinity.Libraries.Model.Image&parentItemType=Telerik.Sitefinity.Libraries.Model.Library&providerName=OpenAccessDataProvider

     

    And in response you will find custom fields

     

4 posts, 1 answered