Orders-orderId-account-attributes:PUT
From Hostway API Documentation
Revision as of 07:51, 15 September 2014 by Mike.robski (Talk | contribs)
PUT /orders/{orderId}/account/attributes
Set the list of attributes for an account in a given order.
Contents |
Request
PUT /orders/{orderId}/account/attributes
Request Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
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
[ { "name": "{attributeName}", "value": "{attributeValue}" }, { "name": "{attributeName}", "value": "{attributeValue}" } ]
Parameters
- attributeName - string
- The unique name of the attribute. The list of supported attribute names is specific to the franchise. The common attributes include:
- partner_account_id - unique account identifier in the partner system. The value should be unique within the franchise.
- attributeValue - string
- The value of the attribute max 200 characters. Should adhere to the rules for the attribute specified by the name.
- The value of the "partner_account_id" attribute is max 100 characters
Response
Status Code
Status Code | Error Message | Description |
---|---|---|
204 No Content | - | The account attributes were successfully set. |
400 Bad Request | POST data error | The request body format is invalid and all attributes must have less than 200 characters. |
Not allowed or not existing MetaData Type | Setting some bad account attributes | |
Partner Account ID cannot exceed 100 characters | - | |
401 Unauthorized | - | No owner Id specified or the specified owner is not authorized to add attributes for this account. |
404 Not Found | Resource not found | The specified order does not exist. |
409 Conflict | Account ID already in use | Attribute value for Partner Account ID, supposed to be unique, is already in use. |
500 Internal Server Error | - | Account has not been set for this order. |
502 Bad Gateway | - | A critical (unknown) error occurred. |
Response Body
None.
Example
Set valid account attribute
Request
PUT /orders/{orderId}/account/attributes Cookie: OwnerId={owner_id}; Path=/ [ { "name":"partner_account_id", "value":"paccid_050914054136" } ]
Response
204 No Content
Set bad account attributes
Request
PUT /orders/{orderId}/account/attributes Cookie: OwnerId={owner_id}; Path=/ [ { "name":"attribute_a", "value":"value_a" }, { "name":"attribute_b", "value":"value_b" } ]
Response
400 Bad Request Content-Type : application/json; charset=UTF-8 { "computeFault": { "guid": "5268a14c-ced6-4f32-87ee-aa6709414396", "message": "Not allowed or not existing MetaData Type", "code": 400, "details": "" } }
Set an attribute with too long value
Request
PUT /orders/{orderId}/account/attributes Cookie: OwnerId={owner_id}; Path=/ [ { "name":"partner_account_id", "value":"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901" } ]
Response
400 Bad Request Content-Type : application/json; charset=UTF-8 { "computeFault": { "guid": "6c0ab111-f5b0-4730-a3fd-0076633b5dee", "message": "POST data error", "code": 400, "details": "" } }
Set too long Partner Account ID value
Request
PUT /orders/{orderId}/account/attributes Cookie: OwnerId={owner_id}; Path=/ [ { "name":"partner_account_id", "value":"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901" } ]
Response
400 Bad Request Content-Type : application/json; charset=UTF-8 { "computeFault": { "guid": "fbad4ff5-120c-4d1e-b2b3-1309937424d7", "message": "Partner Account ID cannot exceed 100 characters", "code": 400, "details": "" } }
Set existing Partner Account ID
Request
PUT /orders/{orderId}/account/attributes Cookie: OwnerId={owner_id}; Path=/ [ { "name":"partner_account_id", "value":"ext_140213131348" } ]
Response
409 Conflict Content-Type : application/json; charset=UTF-8 { "conflict": { "guid": "a8d38abe-1f68-49c5-bafe-29894671ed06", "message": "Account ID already in use", "code": 409, "details": "" } }
Account has not been set
Request
PUT /orders/{orderId}/account/attributes Cookie: OwnerId={owner_id}; Path=/ [ { "name":"partner_account_id", "value":"paccid_050914054136" } ]
Response
500 Internal Server Error Content-Type : application/json; charset=UTF-8 { "computeFault" : { "guid" : "a4eae57d-b172-45ff-ae6e-474a8b6061a0", "timestamp" : "2014-09-10 10:12:41", "code" : 500, "errorRefId" : "a4eae57d-b172-45ff-ae6e-474a8b6061a0" } }
See also