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

From Hostway API Documentation
Jump to: navigation, search

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

Adds Attributes to the Service. Not all services support this call. Depending on the service, this call may return a response code of 405 (method not supported).

Contents


Request

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

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 whose keys/values will depend on the service category of the service. See Service Attributes Structure.

{
  "key_one": "Value One",
  "key_two": "Value Two",
  ...
}
 

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 attribute key/value pair should be allowed for the service specification.

Response

Status Code

Status Code Error Message Description
204 No Content - The operation was successfully completed.
400 Bad Request POST data error Trying to create an attribute without body or with invalid body.
Invalid term supplied -1 Trying to add attributes for transfer domain request with invalid value for term (should be 1).
No attributes defined for the provided service specification Trying to get attributes for service with no attributes.
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: Attributes failed permission check The client does not have permissions to add attributes.
404 Not Found Resource not found The client is trying to add attribute for non existing order, product or service.
405 Method Not Allowed - The service does not support attributes.
502 Bad Gateway - Unexpected backend response.

Response Body

Successful response

None.

Error responses

400 Bad Request - no request body is passed
{
    "badRequest": {
        "guid": "bd80dfdc-5752-4472-96f2-90f590ddb3f9",
        "message": "POST data error",
        "code": 400,
        "details": ""
    }
}

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

400 Bad Request - invalid attributes are passed
{
    "badRequest": {
        "guid": "fdd0b796-c690-47af-9666-0478e2bcae27",
        "message": "POST data error",
        "code": 400,
        "details": {"serverLocation": "String does not match expected pattern"}
    }
}

400 Bad Request - invalid term for transfer request is passed.
{
    "computeFault": {
        "guid": "1e98f8ea-d298-4867-a9aa-0a6486dbefb0",
        "message": "Invalid term supplied -1",
        "code": 400,
        "details": ""
    }
}

400 Bad Request - trying to get the attributes for a service that does not have attributes.
{
    "computeFault": {
        "guid": "756b755a-84cf-4692-b2c6-70808dc9d00d",
        "message": "No attributes defined for the provided service specification",
        "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