This method provides a way to add a new (mt) Media Temple service to the authenticated account.
IMPORTANT: As of April 2018, the Media Temple customer API has been deprecated. Previously created API keys will continue to work until further notice, but you will not be able to generate new keys via the Account Center. If you have any questions about this, please feel free to contact our support team.
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 |
---|---|---|---|---|
serviceType | int | yes | NA | The service type. See also Service Type. |
operatingSystem | int | no | 16 (Ubuntu 9.10 Karmic) | The operating system the service will be provision with. Only available for (ve) services. See also Operating System. |
primaryDomain | String | 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 |
---|---|---|
400 | InvalidServiceType | The requested service type is not valid. |
400 | InvalidDomain | A domain must be specified for this service. |
400 | InvalidOS | The requested Operating System is not valid. |
402 | PaymentFailed | This order was not able to complete due to payment problems. |
500 | UnknownError | There was an unexpected error. |