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,
  "branding_enabled": true,
  "indexed_at": "2014-01-24T13:08:05.012+03:00",
  "robots_header": null,
  "title_format": null,
  "title_separator": null,
  "data": {
    "my_key_1": "Value 1",
    "my_key_2": 2
  },
  "public_url": "http://helloworld.voog.co/",
  "sitemap_enabled": true,
  "sitemap_inc_articles": true,
  "sitemap_inc_tags": false,  
  "has_custom_robots_txt": false,
  "robots_txt": "User-agent: *\nDisallow:\nDisallow: /files/\nDisallow: /photos/\nDisallow: /admin/\n\nsitemap: http://dev.voog.computer/sitemap.xml\n",
  "data_usage": 332682,
  "custom_design": true,
  "seo": {
    "full_title": "Home page – My new site"
  },
  "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

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",
  "robots_header": "noindex",
  "sitemap_enabled": true,
  "sitemap_inc_articles": true,
  "sitemap_inc_tags": false,    
  "has_custom_robots_txt": true,
  "robots_txt": "User-agent: *\nDisallow: /files/\n",  
  "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,
  "branding_enabled": true,
  "title_format": null,
  "title_separator": null,
  "data": {
    "my_new_key": ["foo", "bar"],
    "value": "My value"
  },
  "robots_header": "noindex",
  "public_url": "http://helloworld.voog.co/",
  "sitemap_enabled": true,
  "sitemap_inc_articles": true,
  "sitemap_inc_tags": false,  
  "has_custom_robots_txt": true,
  "robots_txt": "User-agent: *\nDisallow: /files/\n",  
  "data_usage": 332682,
  "custom_design": true
}

Parameters

Optional parameters:

  • search_enabled - turns site search section on/off when implemented in layouts (default: false).
  • branding_enabled - show Voog brand in site footer (default: true).
  • title_format - default title format for site page title tags. Defaults to page_site. Supported values and their corresponding patterns:
    • page_site - <page_title> <separator> <site_title>
    • site_page - <site_title> <separator> <page_title>
    • page - <page_title>
  • title_separator - default title format separator for site page title tags. Defaults to .
  • 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.
  • robots_header - site-level X-Robots-Tag value. Overrides page and article level settings.
  • has_custom_robots_txt - toggle custom robots.txt. If true, but robots_txt is not set, robots_txt will receive a default value. If false, any custom robots.txt will be deleted.
  • robots_txt - custom robots.txt contents. Ignored if has_custom_robots_txt is not true.
  • sitemap_enabled - allow serving sitemap.xml, defaults to true
  • sitemap_inc_articles - include articles in the sitemap, defaults to true
  • sitemap_inc_tags - include blog tags in the sitemap, defaults to false
  • 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,
  "branding_enabled": true,
  "title_format": null,
  "title_separator": null,
  "data": {
    "my_new_key": ["foo", "bar"],
    "value": "new value"
  },
  "robots_header": "noindex",
  "public_url": "http://helloworld.voog.co/",
  "sitemap_enabled": true,
  "sitemap_inc_articles": true,
  "sitemap_inc_tags": false,  
  "has_custom_robots_txt": true,
  "robots_txt": "User-agent: *\nDisallow: /files/\n",    
  "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