Developers

Site

Summary of site endpoints

Get data for the site

GET /admin/api/site

Example response:

Status: 200 OK
{
  "meta_keywords": null,
  "created_at": "2014-01-03T09:19:04.000Z",
  "updated_at": "2014-01-22T14:58:01.000Z",
  "search_enabled": false,
  "indexed_at": "2014-01-24T13:08:05.012+03:00",
  "data": {
    "my_key_1": "Value 1",
    "my_key_2": 2
  },
  "public_url": "http://helloworld.voog.co/",
  "data_usage": 332682,
  "custom_design": true,
  "subscription": {
    "subscription_plan": "plus",
    "subscription_period": "1M",
    "subscription_started_at": "2014-01-03T09:19:05.000Z",
    "subscription_expires_at": "2014-02-03T09:19:05.000Z",
    "active": true,
    "type": "trial"
  },
  "stats": {
    "webtools_verify_key": "googlef52f1d814b8972e9.html",
    "stats_google_analytics": "<script type=\"text/javascript\">\n\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'UA-XXXXXXX-X']);\n _gaq.push(['_setDomainName', 'helloworld.voog.co']);\n</script>",
    "stats_compete": "",
    "stats_chartbeat": "",
    "stats_custom": "",
    "stats_edicy_code": "<script type=\"text/javascript\">\nvar _ews = _ews || {_account: 'A-36-1', _tzo: '7200'};</script>",
    "stats_edicy_timezone": "Tallinn",
    "stats_edicy_utc_offset": 7200
  }
}

Parameters

  • include_subscription - includes site subscription related data (eg ?include_subscription=true).
  • include_stats - includes statistic related attributes (eg ?include_stats=true).

Update attributes of the site

PUT /admin/api/site

This request updates the site attributes with provided attributes. It replaces data attribute with new key set if data attribute is present in request.

PATCH /admin/api/site

This request updates the site attributes with provided attributes. It merges provided keys to data attribute if data attribute is present in request.

Example request:

PUT http://helloworld.voog.co/admin/api/sites

NB! Only site Owners are allowed to make this request. Site Editors can only update data attribute.

Example data:

{
  "search_enabled": true,
  "webtools_verify_key": "googlef52f1d814b8972e9.html",
  "stats_google_analytics": "<script>var analytics=\"1\";</script>",
  "stats_compete": "<script>var compte=\"1\";</script>",
  "stats_chartbeat": "<script>var chartbeat=\"1\";</script>",
  "stats_custom": "<script>var custom=\"1\";</script>",
  "stats_edicy_timezone": "London",
  "data": {
    "my_new_key": ["foo", "bar"],
    "value": "My value"
  }
}

Example response:

Status: 200 OK
{
  "meta_keywords": null,
  "created_at": "2014-01-03T09:19:04.000Z",
  "updated_at": "2014-01-22T15:11:02.000Z",
  "search_enabled": true,
  "data": {
    "my_new_key": ["foo", "bar"],
    "value": "My value"
  },
  "public_url": "http://helloworld.voog.co/",
  "data_usage": 332682,
  "custom_design": true
}

Parameters

Optional parameters:

  • search_enabled - turns site search section on/off when implemented in layouts (default: false).
  • webtools_verify_key - the Google Webmaster tools verification code (file name) in format "googlexxxxxxxxxxxxxxxx.html" (e.g. "googlef52f1d814b8972e9.html", default: null).
  • stats_google_analytics - tracking code for Google Analytics service (default: null).
  • stats_compete - tracking code for Compete service (default: null).
  • stats_chartbeat - tracking code for Chartbeat service (default: null).
  • stats_custom - custom tracking code (appended to output for layout site.analytics variable) (default: null).
  • stats_edicy_timezone - name of the timzone (e.g. "Pacific Time (US & Canada)", default: null). Sets the time-zone for Voog built in reporting system.
  • data - key/value based custom hash store. If attribute data is present in request then new value replaces existing data value. (NB! Keys with prefixes internal_ are protected and read only.)
  • meta_keywords [deprecated] - cross site keywords set (default: null).

Update custom data field of the site

PUT /admin/api/site/data/key_1

Updates or adds a new key to site data keyset.

Example request:

PUT http://helloworld.voog.co/admin/api/sites/data/key_1

Example data:

{
  "value": "new value"
}

Example response:

Status: 200 OK
{
  "meta_keywords": null,
  "created_at": "2014-01-03T09:19:04.000Z",
  "updated_at": "2014-01-22T15:11:02.000Z",
  "search_enabled": true,
  "data": {
    "my_new_key": ["foo", "bar"],
    "value": "new value"
  },
  "public_url": "http://helloworld.voog.co/",
  "data_usage": 332682,
  "custom_design": true
}

Remove a custom field from a site

DELETE /admin/api/site/data/key_1

Example request:

DELETE http://helloworld.voog.co/admin/api/sites/data/key_1

Example response:

Status: 204 No Content