awe.sm Administration API
Connect A Domain To A Subscription
Creates a domain that belongs to a subscription. Allows for as much or as little initial configuration as desired.
POSTapi.awe.sm/domains/new
HTTPS is supported on this endpoint.
Required Parameters
| Parameter | Type | Description |
|---|---|---|
| subscription_key | string | The key of the subscription that owns the hostname being connected. Found in subscription settings. |
| application_key | string | The key of the application authorized to perform administrative actions on the subscription. Found in application settings. |
| json | JSON string | A domain creation object. All fields are optional except for hostname. See below. These values can be changed later using domains/{hostname}/update. |
Domain Creation Object
| Parameter | Type | Description |
|---|---|---|
| hostname | string |
Required. This must be a valid domain name that you have already registered and pointed to awe.sm. The hostname does not include dom.ai/n. Links created on this domain would look like dom.ai/n/12345. This hostname would be specified as dom.ai_n .
|
| root_redirect | string | Required. URL to redirect visitors if your domain is visited with no extra path information. |
| not_found_redirect | string | Required. URL to redirect visitors if the path information is invalid. |
| projects | array of strings | The projects authorized to use this domain, specified by an array of project API keys. |
Example
POST http://api.awe.sm/domains/new?subscription_key=sub-xXXxXxxX&application_key=nZurcZ&json={"hostname":"examp.le","root_redirect":"http://example.com/","not_found_redirect":"http://example.com/404.html"}
{
"request": {
"application_key": "nZurcZ",
"json": "{\"hostname\":\"examp.le\",\"root_redirect\":\"http://example.com/\",\"not_found_redirect\":\"http://example.com/404.html\"}",
"method": "new",
"object": "domain",
"subscription_key": "sub-xXXxXxxX"
},
"response": {
"domain": {
"created_at": "2011-10-25 20:45:28",
"hostname": "examp.le",
"not_found_redirect": "http://example.com/404.html",
"projects": [],
"root_redirect": "http://example.com/",
"updated_at": "2011-10-25 20:45:28"
}
}
}
Last updated 2011-10-27