Accounts:GET

(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 90)
(Examples)
Line 45: Line 45:
 
       "rel" : "self"
 
       "rel" : "self"
 
     }],
 
     }],
     "accountNumber" : "{account-number}"
+
     "accountNumber" : "{account-number}",
 +
    "createdDate" : "{created-date}"
 
   }],
 
   }],
 
   "links" : [{
 
   "links" : [{
Line 71: Line 72:
 
:; accountNumber - ''string''
 
:; accountNumber - ''string''
 
:: The Id of the account
 
:: The Id of the account
 +
 +
:; createdDate - ''date''
 +
:: The date account was created in format Y-m-d
  
 
:;  links - ''list''
 
:;  links - ''list''
Line 77: Line 81:
 
; links - ''list''
 
; links - ''list''
 
: [[Hypermedia]] Link to self and other resources relevant to the account lists
 
: [[Hypermedia]] Link to self and other resources relevant to the account lists
 
  
 
== Examples ==
 
== Examples ==
Line 96: Line 99:
 
         "rel": "self"
 
         "rel": "self"
 
       }],  
 
       }],  
       "accountNumber": "test-account"
+
       "accountNumber": "test-account",
 +
      "createdDate": "2009-12-07"
 
   }],  
 
   }],  
 
   "links": [{
 
   "links": [{
Line 121: Line 125:
 
             "rel" : "self"
 
             "rel" : "self"
 
         }],
 
         }],
         "accountNumber" : "test-account-1"
+
         "accountNumber" : "test-account-1",
 +
        "createdDate": "2009-12-07"
 
       },
 
       },
 
         "status" : "closed",
 
         "status" : "closed",
Line 128: Line 133:
 
             "rel" : "self"
 
             "rel" : "self"
 
         }],
 
         }],
         "accountNumber" : "test-account-2"
+
         "accountNumber" : "test-account-2",
 +
        "createdDate": "20012-11-01"
 
       }],
 
       }],
 
   "links" : [{
 
   "links" : [{

Revision as of 10:04, 4 February 2014

GET /accounts

Retrieves a list of all accounts authorized for access with the provided credentials.

Contents

Request

GET /accounts

URI Parameters

filterStatus - string
Optional. Only accounts with status matching the value of the parameter will be returned. Allowed values are pending, open, suspended, closed.
page - integer
Optional. Specifies which page should be displayed. Requires a pageSize parameter to also be provided.
pageSize - integer
Optional. Specifies the number of entries to be displayed on a page. Default size is 100. Requires a page parameter to also be provided.

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.

Response

Status Code

200 OK
Success
400 Bad Request
401 Unauthorized
The supplied credentials are invalid or do not provide permissions for this operation.
403 Forbidden
Forbidden access to a user not authorized for such access.
415 Unsupported Media Type
The Content-Type header was not specified or the specified type is not supported. Use application/json.

Response Body

{
  "list" : [{
    "status" : "{status}",
    "links" : [{
      "href" : "https://api.hostway.com/accounts/{account-number}/",
      "rel" : "self"
    }],
    "accountNumber" : "{account-number}",
    "createdDate" : "{created-date}"
  }],
  "links" : [{
      "href" : "https://api.hostway.com/accounts?pageSize={pageSize}&page={page}",
      "rel" : "self"
    }, 
    {
      "href" : "https://api.hostway.com/accounts?pageSize={pageSize}&page={page}",
      "rel" : "next"
    }, 
    {
      "href" : "https://api.hostway.com/accounts?pageSize={pageSize}&page={page}",
      "rel" : "last"
  }]
}
 

Parameters

list - list
A collection of dictionaries containing information about specific account
status - string
Describes the status of the account. Valid values are pending, open, suspended, closed
accountNumber - string
The Id of the account
createdDate - date
The date account was created in format Y-m-d
links - list
Hypermedia for this account resource. Links to the account.
links - list
Hypermedia Link to self and other resources relevant to the account lists

Examples

Listing current account only when provided credentials don't give elevated access

Request

GET /accounts
 

Response

{
   "list": [{
      "status": "open", 
      "links": [{
         "href": "https://api.hostway.com/accounts/test-account/", 
         "rel": "self"
      }], 
      "accountNumber": "test-account",
      "createdDate": "2009-12-07"
   }], 
   "links": [{
      "href": "https://api.hostway.com/accounts", 
      "rel": "self"
   }]
}
 


Paginated request when more then one account is returned

Request

GET /accounts?pageSize=2&page=1
 

Response

{
   "list" : [{
         "status" : "open",
         "links" : [{
            "href" : "https://api.hostway.com/accounts/test-account-1/",
            "rel" : "self"
         }],
         "accountNumber" : "test-account-1",
         "createdDate": "2009-12-07"
      },
         "status" : "closed",
         "links" : [{
            "href" : "https://api.hostway.com/accounts/test-account-2/",
            "rel" : "self"
         }],
         "accountNumber" : "test-account-2",
         "createdDate": "20012-11-01"
      }],
   "links" : [{
         "href" : "https://api.hostway.com/accounts?pageSize=2&page=1",
	 "rel" : "self"
      }, 
      {
         "href" : "https://api.hostway.com?pageSize=2&page=2",
         "rel" : "next"
      }, 
      {
         "href" : "https://api.hostway.com?pageSize=2&page=11637",
	 "rel" : "last"
      }]
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox