Photo Galleries

    List all photo galleries

    Get all the photo galleries of a site.

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/photogalleries
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response body

    An array of the first 10 items; each object has the following properties:

    • id - photo gallery ID (number)
    • siteId - site ID (number)
    • photoGallery - photo gallery's name (string)
    • folderId - the photo gallery's folder ID (number)
    • createDate - photo gallery's creation date (dateTime)
    • lastUpdateDate - photo gallery's last update date (dateTime)

    You can output additional fields to those listed above as default, see the API v3 Discovery APP for additional details.

    Accepts and returns JSON as Content-Type.


    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/photogalleries",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    });
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    });

    Sample response

    {
      "items": [
        {
          "id": 4151,
          "siteId": 1767665,
          "photoGallery": "Gallery 1",
          "createDate": "2016-03-15T12:34:04.807",
          "lastUpdateDate": "2016-03-15T12:36:58.14"
        },
        {
          "id": 4152,
          "siteId": 1767665,
          "photoGallery": "Gallery 2",
          "createDate": "2016-03-15T12:38:57.59",
          "lastUpdateDate": "2016-03-15T12:38:57.59"
        }
      ],
      "totalItemsCount": 2,
      "skip": 0,
      "limit": 10
    }

    Get a photo gallery's details

    Get a photo gallery and it's details.

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/photogalleries/[photogallery_ID]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    Displays the details for the photo gallery as a JSON object

    • id - photo gallery ID (number)
    • siteId - site ID (number)
    • photoGallery - photo gallery's name (string)
    • folderId - the photo gallery's folder ID (number)
    • createDate - photo gallery's creation date (dateTime)
    • lastUpdateDate - photo gallery's last update date (dateTime)

    Accepts and returns JSON as Content-Type.


    Sample request

    var access_token = BCAPI.Helper.Site.getAccessToken();
    
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/photogalleries/4151",
        type: "GET",
        connection: "keep-alive",    
        contentType: "application/json",
        headers: {
            "Authorization": $.cookie('access_token')
        }
    });
    request.done(function (msg) {
        console.log(msg);
    })
    request.fail(function (jqXHR) {
        console.log("Request failed.");
        console.log("Error code: " + jqXHR.status);
        console.log("Error text: " + jqXHR.statusText);
        console.log("Response text: " + jqXHR.responseText);
    })

    Sample response

    {
    	"id": 4151,
        "siteId": 1767665,
    	"photoGallery": "Gallery 1",
        "folderId": 751334,
    	"createDate": "2016-03-15T12:34:04.807",
    	"lastUpdateDate": "2016-03-15T12:36:58.14"
    }