Domain aliases

Note: this API is in beta currently and is subject to change in the future.

Domain aliases

The Domain aliases resource allows creation of alternate URLs for Site objects that can be hosted under a different domain and/or directory. These URLs render a copy of the Site, but can modify certain fields to change their properties.

The most common use of Domain aliases is to create alternate URLs for different languages or language/regions.

Domain alias object

Domain alias model

A domain alias contains the following fields

Example object:

{
    "added": "2013-06-19T11:17:13",
    "base_directory": "/succursale/location-name/",
    "custom_fields": {
        "headline": "Emplacement de la marque"
    },
    "deleted": false,
    "domain": "www.brandname.ca",
    "formatted_domain": "www.brandname.ca",
    "formatted_url": "https://www.brandname.ca/succursale/location-name/",
    "id": 12345,
    "language_code": "fr",
    "modified": "2014-01-28T13:20:13",
    "partner_alias_id": "fr-locationpage-55555555",
    "preview_url": "http://www.brandname.ca.whitelabel.cloudbackend.net/succursale/location-name/",
    "site_id": 55555,
    "trace_id": null,
    "user_id": 248114
}

Create a domain alias

POST /api/v2/domain_aliases/

List domain aliases

List all domain aliases including active and deleted

GET /api/v2/domain_aliases/

List all domain aliases associated with a Site ID

GET /api/v2/domain_aliases/?site_id=12345

Parameters

Response

{
  "meta": {
    "limit": 20,
    "next": "/api/v2/domain_aliases/?limit=20&offset=20",
    "offset": 0,
    "previous": null,
    "total_count": 154
  },
  "objects": [
    {
      "added": "2013-06-19T11:17:13",
      "base_directory": "/succursale/location-name/",
      "deleted": false,
      "domain": "www.brandname.ca",
      "formatted_domain": "www.brandname.ca",
      "formatted_url": "https://www.brandname.ca/succursale/location-name/",
      "id": 12345,
      "language_code": "fr",
      "modified": "2014-01-28T13:20:13",
      "partner_alias_id": "fr-locationpage-55555555",
      "preview_url": "http://www.brandname.ca.whitelabel.cloudbackend.net/succursale/location-name/",
      "site_id": 55555,
      "trace_id": null,
      "user_id": 248114
    },
    ....
  ]
}

Get a single domain alias

Fetch the Domain alias detail using the DomainAlias.id

GET /api/v2/domain_aliases/:id/

Updating a domain alias

PUT /api/v2/domain_aliases/:id/

You can PUT a partial or full object to the detail endpoint to update/change values on the Domain alias object. If using a partial object, you must insure that the primary domain alias id is part of the payload.

Disabling / enabling a domain alias

Disabling a domain alias

To disable an active domain alias and clear all cache references to the domain, use the DELETE method on the Domain alias detail endpoint.

DELETE /api/v2/domain_aliases/:id/

Enabling a domain alias

To enable a currently disabled domain alias, you will set the param for deleted to False using the Update endpoint

Last updated