awe.sm Administration API

Updating Domains

Adds or removes project access to a domain.

POSTapi.awe.sm/domains/{hostname}/update

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 update object. All fields are optional except for hostname. See below. These values can be changed later using domains/{hostname}/update.

Domain Update Object

Only include parameters being modified.

Parameter Type Description
root_redirect string URL to redirect visitors if your domain is visited with no extra path information.
not_found_redirect string URL to redirect visitors if the path information is invalid.
projects array of strings Adds projects authorized to use this domain, specified by an array of project API keys.
remove_projects array of strings Removes project authorizations to use a domain, specified by an array of project names, not API keys. Project names can be found using domains/{hostname}/show

Example Domain Update Object

Remember: Only include parameters being modified.

{
    "root_redirect": "http://example.com/",
    "not_found_redirect": "http://example.com/404.html",
    "projects": [
        "9x863xx7xx12x56433059xx8091838f5f5589x71x04f4760490x6x79xx9xx681",
        "x701x90x56x367x752x88xx72x66x86xxxxxxx629x06x9x7xxx529x9xx9xx2x1"
    ],
    "remove_project": [
        "demo",
        "viplist"
    ]
}

Example

Add a project named "demo" with the API key of 9x863xx7xx12x56433059xx8091838f5f5589x71x04f4760490x6x79xx9xx681 to the domain examp.le.

POST http://api.awe.sm/domains/examp.le/update?subscription_key=sub-xXXxXxxX&application_key=nZurcZ&json={"projects":["5x8x1x212434x2153x2x2x2x2x765x36140xxx243xx6xxx876345x8xx11045x9"]}

{
    "request": {
        "application_key": "nZurcZ",
        "hostname": "examp.le",
        "json": "{\"projects\":[\"5x8x1x212434x2153x2x2x2x2x765x36140xxx243xx6xxx876345x8xx11045x9\"]}",
        "method": "update",
        "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": [
                "demo"
            ],
            "root_redirect": "http://example.com/",
            "updated_at": "2011-10-25 20:45:28"
        }
    }
}

Last updated 2011-10-27