Orders-orderId-account-products:GET

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Parameters)
m (1 revision: Release 99)
 
(2 intermediate revisions by 2 users not shown)
Line 30: Line 30:
 
| 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.
 
| 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.
 
| The '''OwnerId''' cookie or the '''Authorization''' header are not specified or do not permit access to the specified order.
 
| The '''OwnerId''' cookie or the '''Authorization''' header are not specified or do not permit access to the specified order.
 +
|-
 +
| 403 Forbidden
 +
| Unauthorized: Products failed permission check
 +
| The client does not have permission to get the products.
 
|-
 
|-
 
| 404 Not Found
 
| 404 Not Found
 
| Resource not found
 
| Resource not found
 
| The client is trying to get the products for non existing order.
 
| The client is trying to get the products for non existing order.
 +
|-
 +
| 502 Bad Gateway
 +
| -
 +
| Unexpected backend response.
 
|}
 
|}
  
 
=== Response Body ===
 
=== Response Body ===
 
+
==== Successful response ====
 
  <nowiki>
 
  <nowiki>
 
200 OK
 
200 OK
Line 47: Line 55:
 
       "offering" : "</nowiki>{{APIBaseURL}}<nowiki>/productSpecifications/{productSpecificationId}/offerings/{productOfferingId}",
 
       "offering" : "</nowiki>{{APIBaseURL}}<nowiki>/productSpecifications/{productSpecificationId}/offerings/{productOfferingId}",
 
       "displayName": "My custom product name",
 
       "displayName": "My custom product name",
       "partnerId": "Partner purchased plan Id",
+
       "partnerId": "PartnerId",
 
       "links": [
 
       "links": [
 
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/products/{orderProductId}", "rel": "self"}
 
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/orders/{orderId}/account/products/{orderProductId}", "rel": "self"}
Line 61: Line 69:
 
}</nowiki>
 
}</nowiki>
  
==== Parameters ====
+
===== Parameters =====
 
; list - ''list''
 
; list - ''list''
 
: List of the products for the given account order. Each element of the list has the following attributes:
 
: List of the products for the given account order. Each element of the list has the following attributes:
  
 
:; status - ''string''
 
:; status - ''string''
:: Current status of the product. Allowed values are '''new''', '''pending''', '''open''', '''suspended''', '''close_pending''', '''closed''' and '''purge_pending'''
+
:: Current status of the product. Allowed values are '''new''', '''pending''', '''open''', '''suspended''', '''closed''' and '''purged'''
  
 
:; services - ''string''
 
:; services - ''string''
Line 75: Line 83:
  
 
:; partnerId - ''string''
 
:; partnerId - ''string''
:: Partner purchased plan id.
+
:: Partner id.
  
 
:; links - ''list''
 
:; links - ''list''
Line 86: Line 94:
 
: [[Hypermedia]] for the list of product resources
 
: [[Hypermedia]] for the list of product resources
  
 
+
==== Error responses ====
 
  <nowiki>401 Unauthorized
 
  <nowiki>401 Unauthorized
  
Line 92: Line 100:
  
 
  <nowiki>
 
  <nowiki>
404 Not Found
+
403 Forbidden - the client does not have permission to get the products.
 +
{
 +
    "forbidden": {
 +
        "guid": "d336dd8e-bc52-44f3-b672-9aa2fac7fbf4",
 +
        "message": "Unauthorized: Products failed permission check",
 +
        "code": 403,
 +
        "details": ""
 +
    }
 +
}</nowiki>
 +
 
 +
<nowiki>
 +
404 Not Found - there is no such order.
 
{
 
{
 
     "itemNotFound": {
 
     "itemNotFound": {
Line 99: Line 118:
 
         "code": 404,
 
         "code": 404,
 
         "details": ""
 
         "details": ""
 +
    }
 +
}</nowiki>
 +
 +
<nowiki>
 +
502 Bad Gateway - unexpected error from the backend.
 +
{
 +
    "computeFault": {
 +
        "guid": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce",
 +
        "timestamp": "2014-09-10 20:59:50",
 +
        "code": 502,
 +
        "errorRefId": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce"
 
     }
 
     }
 
}</nowiki>
 
}</nowiki>

Latest revision as of 09:06, 14 October 2014

[edit] GET /orders/{orderId}/account/products

Get all Product in an account.

Contents


[edit] Request

GET /orders/{orderId}/account/products

[edit] Request 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
200 OK - The products for the order (if any) are successfully returned.
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. The OwnerId cookie or the Authorization header are not specified or do not permit access to the specified order.
403 Forbidden Unauthorized: Products failed permission check The client does not have permission to get the products.
404 Not Found Resource not found The client is trying to get the products for non existing order.
502 Bad Gateway - Unexpected backend response.

[edit] Response Body

[edit] Successful response

200 OK
{
  "list": [
    {
      "status": "open",
      "services": "https://api.hostway.com/orders/{orderId}/account/products/{orderProductId}/services",
      "offering" : "https://api.hostway.com/productSpecifications/{productSpecificationId}/offerings/{productOfferingId}",
      "displayName": "My custom product name",
      "partnerId": "PartnerId",
      "links": [
        {"href": "https://api.hostway.com/orders/{orderId}/account/products/{orderProductId}", "rel": "self"}
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.hostway.com/orders/{orderId}/account/products/",
      "rel": "self"
    }
  ]
}
[edit] Parameters
list - list
List of the products for the given account order. Each element of the list has the following attributes:
status - string
Current status of the product. Allowed values are new, pending, open, suspended, closed and purged
services - string
A link to the services associated with the product
displayName - string
A custom display name for the product.
partnerId - string
Partner id.
links - list
Hypermedia for the product resource
offering - string
Link to the product catalogue offering specifying the given product
links - list
Hypermedia for the list of product resources

[edit] Error responses

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.
403 Forbidden - the client does not have permission to get the products.
{
    "forbidden": {
        "guid": "d336dd8e-bc52-44f3-b672-9aa2fac7fbf4",
        "message": "Unauthorized: Products failed permission check",
        "code": 403,
        "details": ""
    }
}
404 Not Found - there is no such order.
{
    "itemNotFound": {
        "guid": "579951da-5f2c-4db7-9169-25658bfaafdb",
        "message": "Resource not found",
        "code": 404,
        "details": ""
    }
}
502 Bad Gateway - unexpected error from the backend.
{
    "computeFault": {
        "guid": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce",
        "timestamp": "2014-09-10 20:59:50",
        "code": 502,
        "errorRefId": "8ced5fe7-f6a9-4e8f-8700-cfc9fa15e6ce"
    }
}

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox