Orders-orderId-account-products-productId-services-serviceId:PUT

From Hostway API Documentation
Jump to: navigation, search

PUT /orders/{orderId}/account/products/{productId}/services/{serviceId}

Updates a service in order builder. Currently supports only updating the name and the billing cycle of the service.

Contents


Request

PUT /orders/{orderId}/account/products/{productId}/services/{serviceId}

Request Parameters

orderId - string
The unique order Id. The URI of the order is returned by the POST /orders call.
productId - string
UUID specifying the product
serviceId - string
UUID specifying the service

URI Parameters

None.

Request Headers

Content-Type
Required. Set this header to application/json; charset=UTF-8
Cookie
A cookie named OwnerId to identify the client (for most browser clients, the browser will do this automatically, depending on the browser configuration). The value of the cookie would come from the response to the create order request in the Set-Cookie response header.

Request Body

A dictionary containing the keys "billingCycle" and "name" and their values.

{
  "billingCycle": 12,
  "name": "Service Name",
  "associatedTo": [ "https://api.hostway.com/orders/{orderId}/account/products/{productId}/services/{serviceId}", "https://api.hostway.com/accounts/{accountId}/products/{productId}/services/{serviceId}" ],
}
 

Validation Rules

  1. The service URL ( https://api.hostway.com/orders/{orderId}/account/products/{productId}/services/{serviceId} ) should point to a valid service already added to the product.
  2. The dictionary key/value pairs should be valid billing cycle and service name.
  3. The billingCycle and name parameters are required.
  4. Each service URL from the associated services list should point to a valid service already added to the product.
  5. Any associated service that already exists on the account must be open.

Response

Status Code

Status Code Error Message Description
204 No Content - The operation was successfully completed.
400 Bad Request POST data error Trying to update service with empty body or with invalid body.
Unable to change service: invalid cycle Trying to change the billing cycle to value that is not supported by the current service.
401 Unauthorized This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. The OwnerId cookie was not specified or is incorrect.
403 Forbidden Unauthorized: Service failed permission check The client does not have permissions to update the service.
404 Not Found Resource not found The client is trying to update a non existing service.
502 Bad Gateway - Unexpected backend response.

Response Body

Successful response

None.

Error responses

400 Bad Request - invalid or empty body is passed (required field is missing)
{
    "badRequest": {
        "guid": "aae865ae-5102-49d9-b1ef-8a5419cc0ce7",
        "message": "POST data error",
        "code": 400,
        "details": {"billingCycle": "Required", "name": "Required"}
    }
}

400 Bad Request - missing billingCycle
{
    "badRequest": {
        "guid": "aae865ae-5102-49d9-b1ef-8a5419cc0ce7",
        "message": "POST data error",
        "code": 400,
        "details": {"billingCycle": "Required"}
    }
}

400 Bad Request - missing name
{
    "badRequest": {
        "guid": "aae865ae-5102-49d9-b1ef-8a5419cc0ce7",
        "message": "POST data error",
        "code": 400,
        "details": {"name": "Required"}
    }
}

400 Bad Request - invalid billing cycle
{
    "computeFault": {
        "guid": "7c72847f-5138-44e8-ad93-cc80bb5ba7bc",
        "message": "Unable to change service: invalid cycle",
        "code": 400,
        "details": ""
    }
}
401 Unauthorized

This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
404 Not Found - the order or product was not found.
{
    "itemNotFound": {
        "guid": "e1792d8a-5b0a-43ef-adf5-34a0710c8fc5",
        "message": "Resource not found",
        "code": 404,
        "details": ""
    }
}
502 Bad Gateway - unexpected error from the backend.
{
    "computeFault": {
        "guid": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce",
        "timestamp": "2014-09-10 20:59:50",
        "code": 502,
        "errorRefId": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce"
    }
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox