Accounts-accountId-products:GET
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) |
Mike.robski (Talk | contribs) m (1 revision: Release 100) |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 10: | Line 10: | ||
=== URI Parameters === | === URI Parameters === | ||
− | + | ||
+ | ; filterStatus - ''string'' | ||
+ | : Optional. Only products with status matching the value of the parameter will be returned. Allowed values are '''pending''', '''open''', '''suspended''', '''closed'''. | ||
+ | |||
+ | ; filterDisplayName - ''string'' | ||
+ | : Optional. Only products with displayName matching the value of the parameter will be returned. | ||
+ | |||
+ | ; filterPartnerId - ''string'' | ||
+ | : Optional. Only products with parnterId matching the value of the parameter will be returned. | ||
=== Request Headers === | === Request Headers === | ||
Line 33: | Line 41: | ||
{ | { | ||
"name": "Product 1", | "name": "Product 1", | ||
+ | "displayName": "My custom product name", | ||
+ | "partnerId": "Partner Id", | ||
"productSpecification": "</nowiki>{{APIBaseURL}}<nowiki>/productSpecifications/{productSpecId1}", | "productSpecification": "</nowiki>{{APIBaseURL}}<nowiki>/productSpecifications/{productSpecId1}", | ||
+ | "bandwidth": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/products/{productId1}/bandwidth/", | ||
+ | "usage": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/products/{productId1}/usage/", | ||
"status": "open", | "status": "open", | ||
"billingCycle": 1, | "billingCycle": 1, | ||
Line 42: | Line 54: | ||
{ | { | ||
"name": "Product 2", | "name": "Product 2", | ||
+ | "displayName": "My custom product name", | ||
+ | "partnerId": "Partner Id", | ||
"productSpecification": "</nowiki>{{APIBaseURL}}<nowiki>/productSpecifications/{productSpecId2}" | "productSpecification": "</nowiki>{{APIBaseURL}}<nowiki>/productSpecifications/{productSpecId2}" | ||
+ | "bandwidth": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/products/{productId2}/bandwidth/", | ||
+ | "usage": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/products/{productId2}/usage/", | ||
"status": "open", | "status": "open", | ||
"billingCycle": 1, | "billingCycle": 1, | ||
Line 65: | Line 81: | ||
:; name - ''string'' | :; name - ''string'' | ||
:: Descriptive name of the product | :: Descriptive name of the product | ||
+ | |||
+ | :; partnerId - ''string'' | ||
+ | :: Partner Id specified for this product. | ||
:; billingCycle - ''integer'' | :; billingCycle - ''integer'' | ||
Line 71: | Line 90: | ||
:; productSpecification - ''string'' | :; productSpecification - ''string'' | ||
:: [[Hypermedia]] for this product resource. Link to the product's specification. | :: [[Hypermedia]] for this product resource. Link to the product's specification. | ||
+ | |||
+ | :; bandwidth - ''string'' | ||
+ | :: [[Hypermedia]] for this product resource. Link to the bandwidth's information. | ||
+ | |||
+ | :; usage - ''string'' | ||
+ | :: [[Hypermedia]] for this product resource. Link to the usage's information. | ||
:; links - ''list'' | :; links - ''list'' |
Latest revision as of 23:07, 18 November 2014
GET /accounts/{accountId}/products
Retrieves a list of all products associated with a given account.
Contents |
Request
GET /accounts/{accountId}/products
Parameters
- accountId - string
- The Id of the account.
URI Parameters
- filterStatus - string
- Optional. Only products with status matching the value of the parameter will be returned. Allowed values are pending, open, suspended, closed.
- filterDisplayName - string
- Optional. Only products with displayName matching the value of the parameter will be returned.
- filterPartnerId - string
- Optional. Only products with parnterId matching the value of the parameter will be returned.
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
Response
Status Code
- 200 OK
- Success
- 404 Not Found
- The account Id was not found.
- 403 Forbidden
- Access to closed and suspended accounts requires elevated permissions
Response Body
{ "list": [ { "name": "Product 1", "displayName": "My custom product name", "partnerId": "Partner Id", "productSpecification": "https://api.hostway.com/productSpecifications/{productSpecId1}", "bandwidth": "https://api.hostway.com/accounts/{accountId}/products/{productId1}/bandwidth/", "usage": "https://api.hostway.com/accounts/{accountId}/products/{productId1}/usage/", "status": "open", "billingCycle": 1, "links": [ {"href": "https://api.hostway.com/accounts/{accountId}/{productId1}", "rel": "self"} ] }, { "name": "Product 2", "displayName": "My custom product name", "partnerId": "Partner Id", "productSpecification": "https://api.hostway.com/productSpecifications/{productSpecId2}" "bandwidth": "https://api.hostway.com/accounts/{accountId}/products/{productId2}/bandwidth/", "usage": "https://api.hostway.com/accounts/{accountId}/products/{productId2}/usage/", "status": "open", "billingCycle": 1, "links": [ {"href": "https://api.hostway.com/accounts/{accountId}/products/{productId2}", "rel": "self"} ], } ], "links": [ {"href": "https://api.hostway.com/accounts/{accountId}/products", "rel": "self"} ] }
Parameters
- list - list
- A collection of dictionaries containing information about specific products
- status - string
- Describes the status of a product. Valid values are open, closed or suspended
- name - string
- Descriptive name of the product
- partnerId - string
- Partner Id specified for this product.
- billingCycle - integer
- Billing cycle (length of billing period in months) of the service. Allowed values are from 1 to 120
- productSpecification - string
- Hypermedia for this product resource. Link to the product's specification.
- bandwidth - string
- Hypermedia for this product resource. Link to the bandwidth's information.
- usage - string
- Hypermedia for this product resource. Link to the usage's information.
- links - list
- Hypermedia for this product resource. Links to the product.
- links - list
- Hypermedia for this resource. Links to self.
Alternative with partner Id
As an alternative to using the account Id the client can use a partner-specific Id set via the account attribute partner_account_id. The response to this request is the same as the response to a request using the account Id.
GET /partnerAccounts/{partnerAccountId}/products
Parameters
- partnerAccountId - string
- Partner account Id set via the partner_account_id attribute.
See also