(mt):Add service using API

  • This page was last modified on February 18, 2011, at 09:54.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

This method provides a way to add a new (mt) Media Temple service to the authenticated account.

Contents

Request Info

The following URL and HTTP method should be used:

HTTP Method URL
POST




https://api.mediatemple.net/api/v1/services

The following data must be provided as a type-specific object (JSON/XML) in the body of the request:

Parameter Type Required Default Description
serviceTypeintyes n/aThe service type. See also Service type.
operatingSystemintno 16 (Ubuntu 9.10 Karmic) The operating system the service will be provision with. Only available for (ve) services. See also Operating system.
primaryDomainString yes (dv only) (ve) auto-generates a domain The primary domain name for the new service.

Example JSON object

{
"serviceType": 668,
"primaryDomain": "blah.com"
"operatingSystem": 16
}

Response Info

The response will return an HTTP status code to indicate the general category of success or failure to the client. More specific error codes and messages will be contained in the response data itself, if provided. For more information on response codes and parsing response data, see Parsing API responses.

Sample Request

To add a new service of service type 668, do the following:

curl -D log.txt -s -X "POST" -d '{ "serviceType": 668, "primaryDomain": "blah.com", "operatingSystem": 16}' \
     -H "Content-type: application/json" \
     "https://api.mediatemple.net/api/v1/services.json?apikey=a5h34sf62..."

Sample Response

Here is an example of the returned result:

{
"response" : {
"statusCode" : 202,
"timeStamp" : 1284609174311,
"date" : "2010-09-16T03:52:54.311+0000",
"errors" : [ ],
"custom" : [ ]
}
}

Response Errors

All responses should be in the standard response format. For more information, see Parsing API responses.

Status Code Error Code Error Description
400InvalidServiceTypeThe requested service type is not valid.
400InvalidDomainA domain must be specified for this service.
400InvalidOSThe requested Operating System is not valid.
402PaymentFailed This order was not able to complete due to payment problems.
500 UnknownErrorThere was an unexpected error.