Orders-orderId-account-products-productId-services-serviceId-attributes:PUT
(Difference between revisions)
Mike.robski (Talk | contribs) |
(→Request Parameters) |
||
Line 7: | Line 7: | ||
<code>PUT /orders/''{orderId}''/account/products/''{productId}''/services/''{serviceId}''/attributes</code> | <code>PUT /orders/''{orderId}''/account/products/''{productId}''/services/''{serviceId}''/attributes</code> | ||
− | + | === Request Parameters === | |
{{UriParameter-OrderId}} | {{UriParameter-OrderId}} | ||
Line 26: | Line 26: | ||
=== Request Body === | === Request Body === | ||
− | A dictionary whose keys/values will depend on the service category of the service. | + | A dictionary whose keys/values will depend on the service category of the service. See [[ServiceAttributesStructure | Service Attributes Structure]]. |
− | + | <nowiki> | |
+ | { | ||
+ | "key_one": "Value One", | ||
+ | "key_two": "Value Two", | ||
+ | ... | ||
+ | } | ||
+ | </nowiki> | ||
− | + | === Validation Rules === | |
− | + | :# The service URL ( ''{{APIBaseURL}}/orders/{orderId}/account/products/{productId}/services/{serviceId}'' ) should point to a valid service already added to the product. | |
− | + | :# The attribute key/value pair should be allowed for the service specification. | |
− | + | ||
== Response == | == Response == | ||
Line 61: | Line 66: | ||
* [[Orders|Orders API]] | * [[Orders|Orders API]] | ||
* [[Common Features]] | * [[Common Features]] | ||
+ | * [[ServiceAttributesStructure | Service Attributes Structure]] | ||
{{disqus}} | {{disqus}} | ||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:Ordering API]] | [[Category:Ordering API]] |
Revision as of 09:33, 26 September 2013
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
- 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.
- The attribute key/value pair should be allowed for the service specification.
Response
Status Code
- 200 OK
- The attributes were successfully set.
- 400 Bad Request
- The request body contains invalid JSON or the values do not adhere to the restrictions set for them.
- 401 Unauthorized
- The OwnerId cookie was not specified or is incorrect.
- 403 Forbidden
- The client does not have permissions to add services.
- 404 Not Found
- An account has not been added to the given order or the order does not exist.
- 405 Method Not Allowed
- The service does not support attributes.
Response Body
None.
See also