Orders-orderId-action:POST
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 100) |
|||
(8 intermediate revisions by 3 users not shown) | |||
Line 37: | Line 37: | ||
; quoteHash - ''string'' | ; quoteHash - ''string'' | ||
: Optional. Specifies the Id of the previously obtained quote to be used with the action. | : Optional. Specifies the Id of the previously obtained quote to be used with the action. | ||
+ | |||
+ | === Notes === | ||
+ | If a sales agent authorization is provided, the submitted order will be assigned an agent. | ||
== Response == | == Response == | ||
− | |||
=== Status Code === | === Status Code === | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {| class='wikitable' | |
− | : One of the domains to be ordered is already owned by another account | + | |- |
+ | ! Status Code | ||
+ | ! Error Message | ||
+ | ! Description | ||
+ | |- | ||
+ | | 202 Accepted | ||
+ | | align="center" | - | ||
+ | | The requested action was initiated successfully (in case of "submit" action). Check the status of the order for future updates. | ||
+ | |- | ||
+ | | 204 No Content | ||
+ | | align="center" | - | ||
+ | | The requested action was successfully completed (in case of "validate" action) | ||
+ | |- | ||
+ | | rowspan="6" | 400 Bad Request | ||
+ | | rowspan="2" | Account has not been set | ||
+ | | Cannot check contact info because no account (new or existing) has been set in the order. | ||
+ | |- | ||
+ | | Cannot add test attribute because account has not been set. | ||
+ | |- | ||
+ | | No {attribute_name} attribute set. | ||
+ | | A required account attribute has not been set. | ||
+ | |- | ||
+ | | Contact info type {contact_type} is not set | ||
+ | | A required contact info type has not been set. | ||
+ | |- | ||
+ | | All plans in the order must contain at least one product. | ||
+ | | A product does not contain any service. | ||
+ | |- | ||
+ | | Missing plugin data for service type(s): set([u'core.www']) | ||
+ | | Service is missing attribute '''domain'''. | ||
+ | |- | ||
+ | | 401 Unauthorized | ||
+ | | align="center" | - | ||
+ | | No owner Id specified or the specified owner is not authorized to perform actions on this order. | ||
+ | |- | ||
+ | | 403 Forbidden | ||
+ | | Unauthorized: Action failed permission check | ||
+ | | An unassociated user cannot validate or submit order. | ||
+ | |- | ||
+ | | 404 Not Found | ||
+ | | Resource not found | ||
+ | | The specified order does not exist. | ||
+ | |- | ||
+ | | rowspan="9" | 409 Conflict | ||
+ | ! colspan="2" align="center" | Domain-dependent services: | ||
+ | |- | ||
+ | | Cannot create domain alias to the same domain name. | ||
+ | | Duplicate domain. | ||
+ | |- | ||
+ | | Domain {domain_name} is associated with another account | ||
+ | | One of the domains to be ordered is already owned by another account | ||
+ | |- | ||
+ | | A domain in the order contains a restricted word | ||
+ | | One of the domains contains blacklisted word. | ||
+ | |- | ||
+ | | Contains a blacklisted domain | ||
+ | | One of the domains to be ordered is blacklisted. | ||
+ | |- | ||
+ | | Transfer is already in progress for this domain | ||
+ | | A transfer is in progress for a domain. | ||
+ | |- | ||
+ | ! colspan="2" align="center" | Email domain alias service: A domain alias would produce impossible to delivery loops | ||
+ | |- | ||
+ | | rowspan="2" | Domain {domain_name} has circular forwards to alias {alias_name} | ||
+ | | There is an email forwarder from the target domain name to a mailbox of the domain alias with the same username | ||
+ | |- | ||
+ | | There is an email forwarder from the domain alias to a mailbox of the target domain name with the same username | ||
+ | |- | ||
+ | | 502 Bad Gateway | ||
+ | | align="center" | - | ||
+ | | Unexpected backend response. Cannot submit or validate order. | ||
+ | |} | ||
=== Response Body === | === Response Body === | ||
Line 85: | Line 141: | ||
{ | { | ||
"action": "submit" | "action": "submit" | ||
− | } | + | }</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 102: | Line 157: | ||
{ | { | ||
"action": "validate" | "action": "validate" | ||
− | } | + | }</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
<nowiki> | <nowiki> | ||
− | 204 No | + | 204 No Content</nowiki> |
− | + | ||
=== Submit an order with invalid quote === | === Submit an order with invalid quote === | ||
Line 120: | Line 173: | ||
"action" : "submit", | "action" : "submit", | ||
"quoteHash" : "invalid_quote_id" | "quoteHash" : "invalid_quote_id" | ||
− | } | + | }</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 133: | Line 185: | ||
"details": "" | "details": "" | ||
} | } | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
+ | === Order without contact info === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | POST /orders/{orderId}/action | ||
+ | Content-Type:application/json; Charset=UTF-8 | ||
+ | Cookie: OwnerId={ownerId}; Path=/ | ||
+ | |||
+ | { | ||
+ | "action" : "submit", | ||
+ | "quoteHash" : "{quoteId}" | ||
+ | }</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 400 Bad Request | ||
+ | |||
+ | { | ||
+ | "computeFault": { | ||
+ | "guid": "32adf6a1-e710-4362-83c7-7743c7097db9", | ||
+ | "message": "Contact info type \"regular\" is not set", | ||
+ | "code": 400, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Submit an order before a service is added === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | POST /orders/{orderId}/action | ||
+ | Content-Type:application/json; Charset=UTF-8 | ||
+ | Cookie: OwnerId={ownerId}; Path=/ | ||
+ | |||
+ | { | ||
+ | "action" : "submit", | ||
+ | "quoteHash" : "{quoteId}" | ||
+ | }</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 400 Bad Request | ||
+ | |||
+ | { | ||
+ | "computeFault": { | ||
+ | "guid": "7ef492af-3ebe-4334-9e37-5b0365977ef2", | ||
+ | "message": "All plans in the order must contain at least one product.", | ||
+ | "code": 400, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Order without domain attribute === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | POST /orders/{orderId}/action | ||
+ | Content-Type:application/json; Charset=UTF-8 | ||
+ | Cookie: OwnerId={ownerId}; Path=/ | ||
+ | |||
+ | { | ||
+ | "action" : "submit", | ||
+ | "quoteHash" : "{quoteId}" | ||
+ | }</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 400 Bad Request | ||
+ | |||
+ | { | ||
+ | "computeFault": { | ||
+ | "guid": "bc2e3c0c-b4da-43e2-b576-7801180bfb6e", | ||
+ | "message": "Missing plugin data for service type(s): set([u'core.www'])", | ||
+ | "code": 400, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Unassociated user without cookie === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | POST /orders/000001483b9336c4be0a0c89000a19010d347ea2/action | ||
+ | Authorization: {unassociated_user_authorization} | ||
+ | Content-Type: application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "action": "validate" | ||
+ | }</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 403 Forbidden | ||
+ | Content-Type: application/json; charset=UTF-8 | ||
+ | |||
+ | { | ||
+ | "forbidden": { | ||
+ | "guid": "4d1e97e2-1497-48d5-b7a3-b3726656c4b5", | ||
+ | "message": "Unauthorized: Order failed permission check", | ||
+ | "code": 403, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Order containing a domain with blacklisted word === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | POST /orders/{orderId}/action | ||
+ | Content-Type:application/json; Charset=UTF-8 | ||
+ | Cookie: OwnerId={ownerId}; Path=/ | ||
+ | |||
+ | { | ||
+ | "action" : "submit", | ||
+ | "quoteHash" : "{quoteId}" | ||
+ | }</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 409 Conflict | ||
+ | |||
+ | { | ||
+ | "conflict": { | ||
+ | "guid": "bfb2988f-d745-4b2a-9eff-f2deed3451db", | ||
+ | "message": "A domain in the order contains a restricted word", | ||
+ | "code": 409, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
+ | |||
+ | === Domain associated with another account === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | POST /orders/{orderId}/action | ||
+ | Content-Type:application/json; Charset=UTF-8 | ||
+ | Cookie: OwnerId={ownerId}; Path=/ | ||
+ | |||
+ | { | ||
+ | "action" : "submit", | ||
+ | "quoteHash" : "{quoteId}" | ||
+ | }</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | 409 Conflict | ||
+ | |||
+ | { | ||
+ | "conflict": { | ||
+ | "guid": "3fcd11ec-ffb9-47be-b14e-53a74ecb7de2", | ||
+ | "message": "Domain ng-test-hwus-petre-140718a.com is associated with another account", | ||
+ | "code": 409, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
== OPTIONS /orders/''{orderId}''/action == | == OPTIONS /orders/''{orderId}''/action == |
Latest revision as of 23:08, 18 November 2014
[edit] POST /orders/{orderId}/action
Performs an action like validating or submitting an order.
[edit] Request
POST /orders/{orderId}/action
[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
- 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.
[edit] Request Body
{ "action": "{action}", "actionData": {actionData} "quoteHash": {quoteId} }
[edit] Parameters
- action - string
- The action that should be performed. Allowed values are:
- validate - checks the integrity of the order.
- submit - submits the order for processing.
- actionData - dictionary
- Optional. Reserved for data specific for the requested action.
- quoteHash - string
- Optional. Specifies the Id of the previously obtained quote to be used with the action.
[edit] Notes
If a sales agent authorization is provided, the submitted order will be assigned an agent.
[edit] Response
[edit] Status Code
Status Code | Error Message | Description |
---|---|---|
202 Accepted | - | The requested action was initiated successfully (in case of "submit" action). Check the status of the order for future updates. |
204 No Content | - | The requested action was successfully completed (in case of "validate" action) |
400 Bad Request | Account has not been set | Cannot check contact info because no account (new or existing) has been set in the order. |
Cannot add test attribute because account has not been set. | ||
No {attribute_name} attribute set. | A required account attribute has not been set. | |
Contact info type {contact_type} is not set | A required contact info type has not been set. | |
All plans in the order must contain at least one product. | A product does not contain any service. | |
Missing plugin data for service type(s): set([u'core.www']) | Service is missing attribute domain. | |
401 Unauthorized | - | No owner Id specified or the specified owner is not authorized to perform actions on this order. |
403 Forbidden | Unauthorized: Action failed permission check | An unassociated user cannot validate or submit order. |
404 Not Found | Resource not found | The specified order does not exist. |
409 Conflict | Domain-dependent services: | |
Cannot create domain alias to the same domain name. | Duplicate domain. | |
Domain {domain_name} is associated with another account | One of the domains to be ordered is already owned by another account | |
A domain in the order contains a restricted word | One of the domains contains blacklisted word. | |
Contains a blacklisted domain | One of the domains to be ordered is blacklisted. | |
Transfer is already in progress for this domain | A transfer is in progress for a domain. | |
Email domain alias service: A domain alias would produce impossible to delivery loops | ||
Domain {domain_name} has circular forwards to alias {alias_name} | There is an email forwarder from the target domain name to a mailbox of the domain alias with the same username | |
There is an email forwarder from the domain alias to a mailbox of the target domain name with the same username | ||
502 Bad Gateway | - | Unexpected backend response. Cannot submit or validate order. |
[edit] Response Body
Depends on the result.
[edit] Error Response
{
"{errorType}": { "message": "{errorMessage}", "code": {errorCode}, "details": "{errorDetails}" }
}
[edit] Examples
[edit] Submit an order
Request
POST /orders/0000013ca61880fbfc068b33000a02c9d8ef861c/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/ { "action": "submit" }
Response
202 Accepted
[edit] Validate an order
Request
POST /orders/0000013ca61880fbfc068b33000a02c9d8ef861c/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/ { "action": "validate" }
Response
204 No Content
[edit] Submit an order with invalid quote
Request
POST /orders/0000013ca61880fbfc068b33000a02c9d8ef861c/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId=948ce0d4-7cf0-43b6-88a5-2b3f1331b689; Path=/ { "action" : "submit", "quoteHash" : "invalid_quote_id" }
Response
400 Bad Request { "computeFault": { "message": "Account has not been set", "code": 400, "details": "" } }
[edit] Order without contact info
Request
POST /orders/{orderId}/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId={ownerId}; Path=/ { "action" : "submit", "quoteHash" : "{quoteId}" }
Response
400 Bad Request { "computeFault": { "guid": "32adf6a1-e710-4362-83c7-7743c7097db9", "message": "Contact info type \"regular\" is not set", "code": 400, "details": "" } }
[edit] Submit an order before a service is added
Request
POST /orders/{orderId}/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId={ownerId}; Path=/ { "action" : "submit", "quoteHash" : "{quoteId}" }
Response
400 Bad Request { "computeFault": { "guid": "7ef492af-3ebe-4334-9e37-5b0365977ef2", "message": "All plans in the order must contain at least one product.", "code": 400, "details": "" } }
[edit] Order without domain attribute
Request
POST /orders/{orderId}/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId={ownerId}; Path=/ { "action" : "submit", "quoteHash" : "{quoteId}" }
Response
400 Bad Request { "computeFault": { "guid": "bc2e3c0c-b4da-43e2-b576-7801180bfb6e", "message": "Missing plugin data for service type(s): set([u'core.www'])", "code": 400, "details": "" } }
[edit] Unassociated user without cookie
Request
POST /orders/000001483b9336c4be0a0c89000a19010d347ea2/action Authorization: {unassociated_user_authorization} Content-Type: application/json; charset=UTF-8 { "action": "validate" }
Response
403 Forbidden Content-Type: application/json; charset=UTF-8 { "forbidden": { "guid": "4d1e97e2-1497-48d5-b7a3-b3726656c4b5", "message": "Unauthorized: Order failed permission check", "code": 403, "details": "" } }
[edit] Order containing a domain with blacklisted word
Request
POST /orders/{orderId}/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId={ownerId}; Path=/ { "action" : "submit", "quoteHash" : "{quoteId}" }
Response
409 Conflict { "conflict": { "guid": "bfb2988f-d745-4b2a-9eff-f2deed3451db", "message": "A domain in the order contains a restricted word", "code": 409, "details": "" } }
[edit] Domain associated with another account
Request
POST /orders/{orderId}/action Content-Type:application/json; Charset=UTF-8 Cookie: OwnerId={ownerId}; Path=/ { "action" : "submit", "quoteHash" : "{quoteId}" }
Response
409 Conflict { "conflict": { "guid": "3fcd11ec-ffb9-47be-b14e-53a74ecb7de2", "message": "Domain ng-test-hwus-petre-140718a.com is associated with another account", "code": 409, "details": "" } }
[edit] OPTIONS /orders/{orderId}/action
In addition to the POST method the API supports the OPTIONS method for direct browser access to the API. The format of the request is:
OPTIONS /orders/{orderId}/action
[edit] Parameters
- orderId - string
- The unique order Id. The full URI of each order is returned by the POST /orders call.
[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 Status Code
- 200 OK
- Success
- 404 Not Found
- The specified order does not exist.
[edit] Response Headers
- Access-Control-Allow-Methods
- A comma-separated list of request methods supported on this URI.
- Access-Control-Allow-Origin
- All origins are allowed. This header has value *.
[edit] See also