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
Attribute
Type
Description
id
integer
unique id of the domain alias
site_id
integer
Reference id to the Site this domain alias is connected to
user_id
integer
Reference id to the User that created this domain alias
deleted
boolean
Field that denotes if the domain alias is disabled or not
base_directory
string
For landing pages, the directory that the domain alias will be published - Default is /
formatted_domain
string
The hostname/domain where the domain alias is published, including the domain and subdomain (i.e www.example.com)
formatted_url
string
Read-only field that formats the domain, base directory and scheme (i.e. https://www.example.com/)
domain
string
The domain part of the formatted_domain (i.e. www.example.com)
preview_url
string
Preview URL for this domain alias. Should always be available regardless of published status
partner_alias_id
string
Unique ID reference to partner IDs
language_code
string
The default language (plus specific region) for the domain alias. Similar to the values that browsers send. Examples: en, en-us
added
timestamp
Date and time domain alias was created
modified
timestamp
Date and time domain alias was modified

Example object:

1
{
2
"added": "2013-06-19T11:17:13",
3
"base_directory": "/succursale/location-name/",
4
"deleted": false,
5
"domain": "www.brandname.ca",
6
"formatted_domain": "www.brandname.ca",
7
"formatted_url": "https://www.brandname.ca/succursale/location-name/",
8
"id": 12345,
9
"language_code": "fr",
10
"modified": "2014-01-28T13:20:13",
11
"partner_alias_id": "fr-locationpage-55555555",
12
"preview_url": "http://www.brandname.ca.whitelabel.cloudbackend.net/succursale/location-name/",
13
"site_id": 55555,
14
"trace_id": null,
15
"user_id": 248114
16
}
Copied!

Create a domain alias

POST /api/v2/domain_aliases/
Attribute
formatted_domain
site_id

List domain aliases

List all domain aliases including active and deleted
1
GET /api/v2/domain_aliases/
Copied!
List all domain aliases associated with a Site ID
1
GET /api/v2/domain_aliases/?site_id=12345
Copied!

Parameters

Name
Type
Description
language_code
string
Filter for domain aliases with a matching locale
site_id
integer
Filter for domain aliases associated with a particular Site

Response

1
{
2
"meta": {
3
"limit": 20,
4
"next": "/api/v2/domain_aliases/?limit=20&offset=20",
5
"offset": 0,
6
"previous": null,
7
"total_count": 154
8
},
9
"objects": [
10
{
11
"added": "2013-06-19T11:17:13",
12
"base_directory": "/succursale/location-name/",
13
"deleted": false,
14
"domain": "www.brandname.ca",
15
"formatted_domain": "www.brandname.ca",
16
"formatted_url": "https://www.brandname.ca/succursale/location-name/",
17
"id": 12345,
18
"language_code": "fr",
19
"modified": "2014-01-28T13:20:13",
20
"partner_alias_id": "fr-locationpage-55555555",
21
"preview_url": "http://www.brandname.ca.whitelabel.cloudbackend.net/succursale/location-name/",
22
"site_id": 55555,
23
"trace_id": null,
24
"user_id": 248114
25
},
26
....
27
]
28
}
Copied!

Get a single domain alias

Fetch the Domain alias detail using the DomainAlias.id
1
GET /api/v2/domain_aliases/:id/
Copied!

Updating a domain alias

1
PUT /api/v2/domain_aliases/:id/
Copied!
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.
1
DELETE /api/v2/domain_aliases/:id/
Copied!

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 modified 1yr ago