Accounts-accountNumber-web-:GET

From Hostway API Documentation
Jump to: navigation, search

GET /accounts/{accountNumber}/web

Returns a list of websites.

Contents


Request

GET /accounts/{accountNumber}/web/

URI Parameters

accountNumber - string
The user account to which the domain name and the domain name alias belong
filterStatus
The status of the webhosting product (optional), [pending, open, suspended, close_pending, closed ]
filterCreatedAfter
yyyy-mm-dd (optional)
page
page number (optional)
pageSize
number of items per page (optional)

Request Headers

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


Response

Response Body

{
    "totalCount": {totalCount},
    "list": [
        {
            "status": "{status}",
            "createDate": "{createDate}",
            "links": [
                {
                    "href": "https://{apiServer}/accounts/{accountId}/web/{domainName}",
                    "rel": "self"
                }
            ],
            "domainName": "{domainName}"
        }
    ],
    "links": [
        {
            "href": "https://{apiServer}/accounts/{accountId}/web/",
            "rel": "self"
        }
    ]
}
 

Parameters

links - list
Hypermedia for this resource

Status Code

200 OK
Success
401 Unauthorized
The supplied credentials are invalid or do not provide permissions for this operation
403 Forbidden
The authenticated user is not allowed to access this resource
404 Not Found
The domain name or the domain name alias do not exist for the account

Examples

Successful retrieving websites

Request

GET /accounts/acct411359/web?page=12&pageSize=2
 

Response

In this example response, the last two items of the list of 24 matches are returned. The 'next and 'last' navigation links are not provided since this is the last page of the results. For the last item in the list the status is set to 'closed' and therefore there are no links for the product.

{
  'totalCount' => 24,
  'links' => [
               {
                 'rel' => 'self',
                 'href' => 'https://{apiServer}/accounts/acct411359/web?page=12&pageSize=2'
               },
               {
                 'rel' => 'first',
                 'href' => 'https://{apiServer}/accounts/acct411359/web?page=1&pageSize=2'
               },
               {
                 'rel' => 'previous',
                 'href' => 'https://{apiServer}/accounts/acct411359/web?page=11&pageSize=2'
               }
             ],
  'list' => [
              {
                'createDate' => '2015-03-06',
                'status' => 'open',
                'domainName' => 'ng-test-website2-20150306-1200.com',
                'links' => [
                             {
                               'rel' => 'self',
                               'href' => 'http://{apiServer}/accounts/acct411359/web/ng-test-website2-20150306-1200.com'
                             }
                           ]
              },
              {
                'createDate' => '2015-03-06',
                'status' => 'closed',
                'domainName' => 'ng-test-website3-20150306-1200.com'
              }
            ]
}

Successful retrieving websites with filter by closed status

Request

GET /accounts/acct411359/web?page=1&pageSize=100&status=closed
 

Response


{
    "totalCount": 1,
    "list": [
        {
            "status": "closed",
            "createDate": "2015-03-06",
            "uri": "http://cp-rest01-van.vancouver.hostway:8182/accounts/acct411359/web/ng-test-website3-20150306-1200.com",
            "domainName": "ng-test-website3-20150306-1200.com"
        }
    ],
    "links": [
        {
            "href": "http://cp-rest01-van.vancouver.hostway:8182/accounts/acct411359/web?page=1&pageSize=100&status=closed",
            "rel": "self"
        }
    ]
}



blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox