Get Site Details

Gets the details of a site.

Request

  • Method: GET
  • 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: /api/v2/admin/sites/[siteId]
    • Alternatively, use 'current' instead of siteId
  • Authorization header: This should contain the authorization token. Here is how to obtain the token.

Response

site object with the following properties:

  • id - (integer)
  • name - (string)
  • links
    • rel "self" - this link was designed to be used only for retrieving detailed information about the site, and should not be used to manually build other links from it. This is because, as the BC system is designed right now, the site detailed info available at "self" link is stored only on Master DC, and therefore you’ll always get a link to http://api-apac.worldsecuresystems.com in the self link for all sites in BC. This may change in the future though, so do not build any logic around the fact that self always pints to master, or http://api-apac.worldsecuresystems.com
    • rel "photogalleries" - this link provides the URL where photogalleries-specific operations should be made, for the current site
    • rel "siteLogin" - this link provides the URL where site authentication should be made, for the current site
    • rel "create" - link to be used in case a new Site entity needs to be created
    • rel "storage" - this link provides the URL where storage-specific operations should be made (file upload, remove files, etc), for the current site
    • rel "siteUsers" - this link provides the URL where user-specific operations should be made; this is only used to manage users for the current site
  • siteLinks
    • rel "systemUrl" - denotes the system url of this site, like http://mysite.businesscatalyst.com
    • rel "secureUrl" - denotes the secure url of this site, like https://mysite.worldsecuresystems.com
  • dataCenterId - (integer)
  • daysToExpiry - (integer)
  • displayExpiryWarning - (boolean)
  • pathWithTags - (string)
  • pathWithoutTags - (string)
  • siteStatus - (integer)
  • siteStatusDescription - (string)
  • canExtendExpiryDate - (boolean)
  • readyToGoLive - (boolean)
  • isPartnerSite - (boolean)
  • useAdvancedModuleDataEdit - Flag used to turn off any client (Dreamweaver) functionality to pass current selection as query param to /Utilities/EditModuleData.aspx. If set to false, client should send only module token (i.e. module_product) without any other parameters.

Available Site Status codes

Status Code (hexa) Code (decimal)
Unknown 0x00 0
TrialInProgress 0x01 1
TrialExpired 0x02 2
GracePeriod 0x04 4
Deleted 0x08 8
Disabled 0x10 16
Paid 0x20 32
Free 0x40 64

Accepts and returns JSON as Content-Type.


Request:

GET /api/v2/admin/sites/current HTTPS/1.1
Content-Type: application/json

Response:

{
    "id": 246884,
    "name": "perfume",
    "links": [{
        "rel": "self",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884"
    }, {
        "rel": "photogalleries",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/photogalleries"
    }, {
        "rel": "siteLogin",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/tokens"
    }, {
        "rel": "oneTimeToken",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/tokens/onetime"
    }, {
        "rel": "create",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/pp/sites"
    }, {
        "rel": "storage",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/storage"
    }, {
        "rel": "siteUsers",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/users"
    }, {
        "rel": "dreamweaverSiteDefinition",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/dreamweaver/definition"
    }, {
        "rel": "modules",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/rendering/modules"
    }, {
        "rel": "publicTypes",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/rendering/types"
    }, {
        "rel": "bindingRules",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/rendering/bindings/rules"
    }, {
        "rel": "webforms",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/webforms"
    }, {
        "rel": "customFieldTypes",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/webformfieldtypes/custom"
    }, {
        "rel": "systemFieldTypes",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/webformfieldtypes/system"
    }, {
        "rel": "workflows",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/workflows"
    }, {
        "rel": "features",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/features"
    }, {
        "rel": "deviceRedirects",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/redirects/devices"
    }, {
        "rel": "webapps",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/webapps"
    }, {
        "rel": "categories",
        "uri": "https://api-ava.worldsecuresystems.com/api/v2/admin/sites/246884/categories"
    }],
    "siteLinks": [{
        "rel": "systemUrl",
        "uri": "http://perfume10.bcrb.tk/"
    }, {
        "rel": "siteThumbUrl",
        "uri": "http://perfume10.bcrb.tk/CatalystImages/SitePreview/sitepreview-118x100.png"
    }, {
        "rel": "secureUrl",
        "uri": "https://perfume10.worldsecuresystems.com/"
    }, {
        "rel": "toolboxPanelUrl",
        "uri": "http://perfume10.bcrb.tk/Admin/Index2.aspx?A=DW&SiteAuthToken=@@siteAuthTok…rsion%40%40%26AppColor%3d%40%40dwColor%40%40%26Language%3d%40%40lang%40%40"
    }, {
        "rel": "adminUrl",
        "uri": "http://perfume10.bcrb.tk/Admin/Index2.aspx?A=DW&SiteAuthToken=@@siteAuthToken@@&URL=%2fAdminConsole%2f"
    }, {
        "rel": "publicUrl",
        "uri": "http://perfume10.bcrb.tk/"
    }, {
        "rel": "manageUrl",
        "uri": "https://ava.worldsecuresystems.com/Admin/GoSite.aspx?SiteGuid=3548c582-a7be-4801-a42a-8c2b8a05d7b0"
    }],
    "useAdvancedModuleDataEdit": true,
    "siteStatus": 1,
    "billingMethodTypeId": 0,
    "createDate": "2011-09-20T23:04:54",
    "dataCenterId": 7,
    "daysToExpiry": 2052,
    "displayExpiryWarning": false,
    "pathWithTags": ["/Layouts/"],
    "pathWithoutTags": ["/Layouts/SystemMessages/"],
    "siteStatusDescription": "TrialInProgress",
    "canExtendExpiryDate": false,
    "readyToGoLive": false,
    "isPartnerSite": false
}

Sample code

var request = $.ajax({
    "url": "/api/v2/admin/sites/current",
    "headers": {
        "Authorization": $.cookie('access_token')
    },
    "contentType": "application/json"
})

request.done(function (msg) {
    console.log(JSON.stringify(msg));
})

request.fail(function (jqXHR) {
    console.log("Get site list failed.");
    console.log("Error code: " + jqXHR.status);
    console.log("Error text: " + jqXHR.statusText);
    console.log("Response text: " + jqXHR.responseText);
})

Error codes

This method will return the following error codes:

  • 200 - success
  • 400 - bad request
    • 100002 sub error code - the site id is not found. It either doesn't exist in the system, or the current user doesn't belong it that site.
    • 109001 sub error code - not enough privileges (user is not a partner/partner of the site when he attempts to set ReadyToGoLive)
    • 103001 sub error code - cannot extend trial site validity
    • 103004 sub error code - invalid extension period
  • 401 - when authentication token is incorrect or missing
  • 500 - Internal server error