Orders-orderId:DELETE
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) m (1 revision: Release 99) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 15: | Line 15: | ||
== Response == | == Response == | ||
− | |||
=== Status Code === | === Status Code === | ||
− | + | {| class="wikitable" | |
− | + | ! Status Code | |
+ | ! Error Message | ||
+ | ! Description | ||
+ | |- | ||
+ | | 204 No Content | ||
+ | | align="center" | - | ||
+ | | Order was successfully deleted. | ||
+ | |- | ||
+ | | 401 Unauthorized | ||
+ | | align="center" | - | ||
+ | | The '''OwnerId''' cookie or the '''Authorization''' header are not specified or do not permit deletion of the specified order. | ||
+ | |- | ||
+ | | 403 Forbidden | ||
+ | | Unauthorized: Order failed permission check | ||
+ | | Access an associated order as an authenticated user, not associated with the order. | ||
+ | |- | ||
+ | | 404 Not Found | ||
+ | | Resource not found | ||
+ | | The specified order does not exist or it was previously deleted. | ||
+ | |- | ||
+ | | 405 Method Not Allowed | ||
+ | | Method not allowed | ||
+ | | The order was submitted and cannot be deleted. | ||
+ | |} | ||
− | + | == Example == | |
− | + | ||
− | + | === Success === | |
− | : | + | '''Request''' |
+ | <nowiki> | ||
+ | DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c | ||
+ | Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/</nowiki> | ||
− | + | '''Response''' | |
+ | <nowiki> | ||
+ | 204 No Content</nowiki> | ||
− | === Request === | + | === No permission === |
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2 | ||
+ | Cookie: OwnerId=wrong_owner_id; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 401 Unauthorized | ||
+ | Content-Type: text/plain; charset=UTF-8 | ||
+ | |||
+ | 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.</nowiki> | ||
+ | |||
+ | === Unassociated user without cookie=== | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2 | ||
+ | Authorization: {unassociated_user_authorization}</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 403 Forbidden | ||
+ | Content-Type: application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "forbidden" : { | ||
+ | "guid" : "bb99d8e5-cb4a-4c87-9c03-57743ef06ac7", | ||
+ | "message" : "Unauthorized: Order failed permission check", | ||
+ | "code" : 403, | ||
+ | "details" : "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Order does not exist === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2 | ||
+ | Cookie: OwnerId=0b3fc7bd-6905-4de7-bddb-43d2c7365e7a; Path=/</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 404 Not Found | ||
+ | Content-Type: application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "itemNotFound": { | ||
+ | "guid": "3d9b09b4-9737-473b-91a5-6a8d2d212581", | ||
+ | "message": "Resource not found", | ||
+ | "code": 404, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Order has already been submitted === | ||
+ | '''Request''' | ||
<nowiki> | <nowiki> | ||
DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c | DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c | ||
− | Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/ | + | Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/</nowiki> |
− | + | ||
− | + | '''Response''' | |
<nowiki> | <nowiki> | ||
− | + | 405 Method Not Allowed | |
− | + | Content-Type: application/json; charset=UTF-8 | |
+ | |||
+ | { | ||
+ | "badMethod": { | ||
+ | "guid": "93343aac-1451-4ed1-bca8-ac143f263cbe", | ||
+ | "message": "Method not allowed", | ||
+ | "code": 405, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
== See also == | == See also == |
Latest revision as of 09:06, 14 October 2014
[edit] DELETE /orders/{orderId}
Deletes an order. Only new orders that were not submitted can be deleted.
Contents |
[edit] Request
DELETE /orders/{orderId}
[edit] Parameters
- orderId - string
- The unique order Id. The URI of the order is returned by the POST /orders call.
[edit] URI Parameters
None.
[edit] Request Headers
- 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.
[edit] Response
[edit] Status Code
Status Code | Error Message | Description |
---|---|---|
204 No Content | - | Order was successfully deleted. |
401 Unauthorized | - | The OwnerId cookie or the Authorization header are not specified or do not permit deletion of the specified order. |
403 Forbidden | Unauthorized: Order failed permission check | Access an associated order as an authenticated user, not associated with the order. |
404 Not Found | Resource not found | The specified order does not exist or it was previously deleted. |
405 Method Not Allowed | Method not allowed | The order was submitted and cannot be deleted. |
[edit] Example
[edit] Success
Request
DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/
Response
204 No Content
[edit] No permission
Request
DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2 Cookie: OwnerId=wrong_owner_id; Path=/
Response
401 Unauthorized Content-Type: text/plain; charset=UTF-8 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.
[edit] Unassociated user without cookie
Request
DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2 Authorization: {unassociated_user_authorization}
Response
403 Forbidden Content-Type: application/json; charset=UTF-8 { "forbidden" : { "guid" : "bb99d8e5-cb4a-4c87-9c03-57743ef06ac7", "message" : "Unauthorized: Order failed permission check", "code" : 403, "details" : "" } }
[edit] Order does not exist
Request
DELETE /orders/000001483b9336c4be0a0c89000a19010d347ea2 Cookie: OwnerId=0b3fc7bd-6905-4de7-bddb-43d2c7365e7a; Path=/
Response
404 Not Found Content-Type: application/json; charset=UTF-8 { "itemNotFound": { "guid": "3d9b09b4-9737-473b-91a5-6a8d2d212581", "message": "Resource not found", "code": 404, "details": "" } }
[edit] Order has already been submitted
Request
DELETE /orders/0000013ca61880fbfc068b33000a02c9d8ef861c Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/
Response
405 Method Not Allowed Content-Type: application/json; charset=UTF-8 { "badMethod": { "guid": "93343aac-1451-4ed1-bca8-ac143f263cbe", "message": "Method not allowed", "code": 405, "details": "" } }
[edit] See also