Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Hostnames API

« API Overview

The Hostname resources allow you create, view and modify the custom hostnames and domains associated with an application.

Contents

List Hostnames

Retrieves a list of the current custom domains for the application. The item properties are the same as the hostname detail with the addition of the URL for the detail resource for each item.

Request

GET /applications/:slug/hostnames

Response

Status: 200 OK

[{
    "value" : "example.org",
    "canonical" : false,
    "url" : "https://appharbor.com/applications/:slug/hostnames/:id"
}]

Get Hostname Detail

Retrieves the settings for the specified hostname.

Request

GET /applications/:slug/hostnames/:id

Response

Status: 200 OK

{
    "value" : "example.org",
    "canonical" : false
}

Response Properties

value The fully-qualified domain name.
canonical If true, all other hostnames will redirect requests to this hostname.

Create Hostname

Adds the specified domain name to the application.

IMPORTANT: Adding hostnames to an application incurs a cost, see the pricing page for details.

Request

POST /applications/:slug/hostnames

{
    "value" : "example.org"
}

Request Parameters

value Required The fully-qualified domain name to add.

Response

Status: 201 Created
Location: https://appharbor.com/applications/:slug/hostnames/:id

Remove a Hostname

Delete a custom hostname from the application.

Request

DELETE /applications/:slug/hostnames/:id

Response

Status: 204 No Content

Back to overview