Orders-orderId-account-contactInfo-contactType:DELETE

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
 
m (1 revision: Release 99)
 
(4 intermediate revisions by 2 users not shown)
Line 22: Line 22:
  
 
== Response ==
 
== Response ==
 +
{| class='wikitable'
 +
|-
 +
! Status Code
 +
! Error Message
 +
! Description
 +
|-
 +
| 204 No Content
 +
| align="center" | -
 +
| The contact info was successfully deleted.
 +
|-
 +
| rowspan="3" | 404 Not Found
 +
| rowspan="3" | Resource not found
 +
| The specified order does not exist.
 +
|-
 +
| An account has not been added to the given order.
 +
|-
 +
| The specified contact type is not set
 +
|-
 +
| 401 Unauthorized
 +
| align="center" | -
 +
| No owner Id specified or the specified owner is not authorized to delete contact info for this order.
 +
|-
 +
| 403 Forbidden
 +
| Unauthorized: ContactInfo failed permission check
 +
| Delete account contact info as an authenticated user, not associated with the order.
 +
|-
 +
| 502 Bad Gateway
 +
| align="center" | -
 +
| Unexpected backend response. Cannot delete contact info.
 +
|}
  
=== Status Code ===
+
== Example ==
;204 No Content
+
=== Successfully delete contact type of an order ===
: The operation was successfully completed.
+
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/contactInfo/billing
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
  
;404 Not Found
+
'''Response'''
: An account has not been added to the given order, the order does not exist or the specified contact type is not set.
+
<nowiki>
 +
204 No Content</nowiki>
 +
 
 +
=== Get contact info with wrong OwnerId ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/contactInfo/billing
 +
Cookie: OwnerId={wrong_order_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/{orderId}/account/contactInfo/billing
 +
Authorization: {unassociated_user_authorization}</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
403 Forbidden
 +
Content-Type: application/json; charset=UTF-8
 +
 
 +
{
 +
  "forbidden" : {
 +
    "guid" : "53fd5c41-a4b1-48d1-8196-43fc5ba32cf2",
 +
    "message" : "Unauthorized: ContactInfo failed permission check",
 +
    "code" : 403,
 +
    "details" : ""
 +
  }
 +
}</nowiki>
 +
 
 +
=== Delete contact info of unset contact type ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/contactInfo/billing
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 
 +
{
 +
  "itemNotFound": {
 +
    "guid": "3f8d5d31-3986-4075-8a13-5fe3e20a2be4",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 
 +
=== Accout has not been set ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{orderId}/account/contactInfo/billing
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 
 +
{
 +
  "itemNotFound": {
 +
    "guid": "3f8d5d31-3986-4075-8a13-5fe3e20a2be4",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
 +
 
 +
=== Order does not exist ===
 +
'''Request'''
 +
<nowiki>
 +
DELETE /orders/{non-existent_orderId}/account/contactInfo/billing
 +
Cookie: OwnerId={owner_id}; Path=/</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
404 Not Found
 +
Content-Type : application/json; charset=UTF-8
 +
 
 +
{
 +
  "itemNotFound": {
 +
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
 +
    "message": "Resource not found",
 +
    "code": 404,
 +
    "details": ""
 +
  }
 +
}</nowiki>
  
 
== See also ==
 
== See also ==

Latest revision as of 10:06, 14 October 2014

DELETE /orders/{orderId}/account/contactInfo/{contactType}

Deletes the account contact details for a given contact type in an order.

Contents


Request

DELETE /orders/{orderId}/account/contactInfo/{contactType}

Request Parameters

orderId - string
The unique order Id. The URI of the order is returned by the POST /orders call.
contact_type - string
Contact Type (regular, billing, administrator or technical)

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.

Response

Status Code Error Message Description
204 No Content - The contact info was successfully deleted.
404 Not Found Resource not found The specified order does not exist.
An account has not been added to the given order.
The specified contact type is not set
401 Unauthorized - No owner Id specified or the specified owner is not authorized to delete contact info for this order.
403 Forbidden Unauthorized: ContactInfo failed permission check Delete account contact info as an authenticated user, not associated with the order.
502 Bad Gateway - Unexpected backend response. Cannot delete contact info.

Example

Successfully delete contact type of an order

Request

DELETE /orders/{orderId}/account/contactInfo/billing
Cookie: OwnerId={owner_id}; Path=/

Response

204 No Content

Get contact info with wrong OwnerId

Request

DELETE /orders/{orderId}/account/contactInfo/billing
Cookie: OwnerId={wrong_order_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.

Unassociated user without cookie

Request

DELETE /orders/{orderId}/account/contactInfo/billing
Authorization: {unassociated_user_authorization}

Response

403 Forbidden
Content-Type: application/json; charset=UTF-8

{
  "forbidden" : {
    "guid" : "53fd5c41-a4b1-48d1-8196-43fc5ba32cf2",
    "message" : "Unauthorized: ContactInfo failed permission check",
    "code" : 403,
    "details" : ""
  }
}

Delete contact info of unset contact type

Request

DELETE /orders/{orderId}/account/contactInfo/billing
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not Found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "3f8d5d31-3986-4075-8a13-5fe3e20a2be4",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

Accout has not been set

Request

DELETE /orders/{orderId}/account/contactInfo/billing
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not Found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "3f8d5d31-3986-4075-8a13-5fe3e20a2be4",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

Order does not exist

Request

DELETE /orders/{non-existent_orderId}/account/contactInfo/billing
Cookie: OwnerId={owner_id}; Path=/

Response

404 Not Found
Content-Type : application/json; charset=UTF-8

{
  "itemNotFound": {
    "guid": "80d5e49e-0795-4209-a929-1ee051e0f252",
    "message": "Resource not found",
    "code": 404,
    "details": ""
  }
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox