Accounts-accountId-Contacts:GET

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(Response Body)
Line 27: Line 27:
 
=== Response Body ===
 
=== Response Body ===
 
  <nowiki>
 
  <nowiki>
[
+
{
   {
+
   "regular": {
    "ContactType": "billing",
+
     "city": "Chicago",
    "AccountId": 100144677,
+
     "countryCode": "US",
    "Id": 100429415,
+
     "email1": "test@test.com",
     "City": "Chicago",  
+
     "email2": "",
     "FirstName": "John",
+
     "fax": "",
    "LastName": "Smith",
+
     "firstName": "John",
    "State": "IL",  
+
     "lastName": "Smith",
     "Email": "test@test.com",  
+
     "middleName": "",
     "Fax": "",  
+
     "phone1": "555-555-5501",
     "Zip": "60001",  
+
     "phone2": "",
     "Deleted": 0,
+
     "postalCode": "60001",
    "Company": "Hostway co",  
+
     "stateOrProvince": "IL",
     "Phone": "555-555-5501",  
+
     "street1": "100 Main St.",
     "Phone2Clean": "",  
+
     "street2": ""
     "MiddleName": "",
+
    "Country": "US",
+
    "AccountNumber": "test-account11111",  
+
     "PhoneClean": "5555555501",  
+
     "Agent": "n/a",  
+
     "Phone2": "",  
+
     "Street": "100 Main St.",  
+
     "Email2": "",
+
    "Street2": ""
+
 
   },
 
   },
   {
+
   "billing": {
    "ContactType": "regular",
+
     "city": "Chicago",
    "Id": 100429416,
+
     "countryCode": "US",
    "AccountId": 100144677,
+
     "email1": "test@test.com",
     "City": "Chicago",  
+
     "email2": "",
     "FirstName": "John",
+
     "fax": "",
    "LastName": "Smith",
+
     "firstName": "John",
    "State": "IL",  
+
     "lastName": "Smith",
     "Email": "test@test.com",  
+
     "middleName": "",
     "Fax": "",  
+
     "phone1": "555-555-5501",
     "Zip": "60001",  
+
     "phone2": "",
     "Deleted": 0,
+
     "postalCode": "60001",
    "Company": "Hostway co",  
+
     "stateOrProvince": "IL",
     "Phone": "555-555-5501",  
+
     "street1": "100 Main St.",
     "Phone2Clean": "",  
+
     "street2": ""
     "MiddleName": "",
+
    "Country": "US",
+
    "AccountNumber": "test-account11111",  
+
     "PhoneClean": "5555555501",  
+
     "Agent": "n/a",  
+
     "Phone2": "",  
+
     "Street": "100 Main St.",  
+
     "Email2": "",
+
    "Street2": ""
+
 
   },
 
   },
   {
+
   "administrator": {
    "ContactType": "administrator",
+
     "city": "Chicago",
    "Id": 100429417,
+
     "countryCode": "US",
    "AccountId": 100144677,
+
     "email1": "test@test.com",
     "City": "Chicago",  
+
     "email2": "",
     "FirstName": "John",
+
     "fax": "",
    "LastName": "Smith",
+
     "firstName": "John",
    "State": "IL",  
+
     "lastName": "Smith",
     "Email": "test@test.com",  
+
     "middleName": "",
     "Fax": "",  
+
     "phone1": "555-555-5501",
     "Zip": "60001",  
+
     "phone2": "",
     "Deleted": 0,
+
     "postalCode": "60001",
    "Company": "Hostway co",  
+
     "stateOrProvince": "IL",
     "Phone": "555-555-5501",  
+
     "street1": "100 Main St.",
     "Phone2Clean": "",  
+
     "street2": ""
     "MiddleName": "",
+
    "Country": "US",
+
    "AccountNumber": "test-account11111",  
+
     "PhoneClean": "5555555501",  
+
     "Agent": "n/a",  
+
     "Phone2": "",  
+
     "Street": "100 Main St.",  
+
     "Email2": "",
+
    "Street2": ""
+
 
   },
 
   },
   {
+
   "technical": {
    "ContactType": "technical",
+
     "city": "Chicago",
    "Id": 100429418,
+
     "countryCode": "US",
    "AccountId": 100144677,
+
     "email1": "test@test.com",
     "City": "Chicago",  
+
     "email2": "",
     "FirstName": "John",
+
     "fax": "",
    "LastName": "Smith",
+
     "firstName": "John",
    "State": "IL",  
+
     "lastName": "Smith",
     "Email": "test@test.com",  
+
     "middleName": "",
     "Fax": "",  
+
     "phone1": "555-555-5501",
     "Zip": "60001",  
+
     "phone2": "",
     "Deleted": 0,
+
     "postalCode": "60001",
    "Company": "Hostway co",  
+
     "stateOrProvince": "IL",
     "Phone": "555-555-5501",  
+
     "street1": "100 Main St.",
     "Phone2Clean": "",  
+
     "street2": ""
     "MiddleName": "",
+
    "Country": "US",
+
    "AccountNumber": "test-account11111",  
+
     "PhoneClean": "5555555501",  
+
     "Agent": "n/a",  
+
     "Phone2": "",  
+
     "Street": "100 Main St.",  
+
     "Email2": "",
+
    "Street2": ""
+
 
   }
 
   }
]
+
}
 
  </nowiki>
 
  </nowiki>
 
  
 
== Examples ==
 
== Examples ==

Revision as of 14:09, 27 September 2013

GET /accounts/{accountId}/contacts

Get contact details for an account.

Contents


Request

GET /accounts/{accountId}/contacts

Request Parameters

accountId - string
The unique account Id.

URI Parameters

None.

Request Headers

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

Response

Status Code

200 OK
Success
404 Not Found
The specified account Id does not exist or is purged.

Response Body

{
  "regular": {
    "city": "Chicago",
    "countryCode": "US",
    "email1": "test@test.com",
    "email2": "",
    "fax": "",
    "firstName": "John",
    "lastName": "Smith",
    "middleName": "",
    "phone1": "555-555-5501",
    "phone2": "",
    "postalCode": "60001",
    "stateOrProvince": "IL",
    "street1": "100 Main St.",
    "street2": ""
  },
  "billing": {
    "city": "Chicago",
    "countryCode": "US",
    "email1": "test@test.com",
    "email2": "",
    "fax": "",
    "firstName": "John",
    "lastName": "Smith",
    "middleName": "",
    "phone1": "555-555-5501",
    "phone2": "",
    "postalCode": "60001",
    "stateOrProvince": "IL",
    "street1": "100 Main St.",
    "street2": ""
  },
  "administrator": {
    "city": "Chicago",
    "countryCode": "US",
    "email1": "test@test.com",
    "email2": "",
    "fax": "",
    "firstName": "John",
    "lastName": "Smith",
    "middleName": "",
    "phone1": "555-555-5501",
    "phone2": "",
    "postalCode": "60001",
    "stateOrProvince": "IL",
    "street1": "100 Main St.",
    "street2": ""
  },
  "technical": {
    "city": "Chicago",
    "countryCode": "US",
    "email1": "test@test.com",
    "email2": "",
    "fax": "",
    "firstName": "John",
    "lastName": "Smith",
    "middleName": "",
    "phone1": "555-555-5501",
    "phone2": "",
    "postalCode": "60001",
    "stateOrProvince": "IL",
    "street1": "100 Main St.",
    "street2": ""
  }
}
 

Examples

Successful Request

Request

GET /accounts/{accountId}/contacts
Authorization: Basic {Base64-encoded username & password string}
 

Response

200 OK

[
   {
      "City": "Chicago", 
      "FirstName": "John", 
      "LastName": "Smith", 
      "State": "IL", 
      "Email": "test@test.com", 
      "Fax": "", 
      "Zip": "60001", 
      "Deleted": 0, 
      "Company": "Hostway co", 
      "Phone": "555-555-5501", 
      "ContactType": "billing", 
      "AccountId": 100144677, 
      "Phone2Clean": "", 
      "MiddleName": "", 
      "Country": "US", 
      "AccountNumber": "test-account11111", 
      "PhoneClean": "5555555501", 
      "Agent": "n/a", 
      "Id": 100429415, 
      "Phone2": "", 
      "Street": "100 Main St.", 
      "Email2": "", 
      "Street2": ""
   },
   {
      "City": "Chicago", 
      "FirstName": "John", 
      "LastName": "Smith", 
      "State": "IL", 
      "Email": "test@test.com", 
      "Fax": "", 
      "Zip": "60001", 
      "Deleted": 0, 
      "Company": "Hostway co", 
      "Phone": "555-555-5501", 
      "ContactType": "regular", 
      "AccountId": 100144677, 
      "Phone2Clean": "", 
      "MiddleName": "", 
      "Country": "US", 
      "AccountNumber": "test-account11111", 
      "PhoneClean": "5555555501", 
      "Agent": "n/a", 
      "Id": 100429416, 
      "Phone2": "", 
      "Street": "100 Main St.", 
      "Email2": "", 
      "Street2": ""
   },
   {
      "City": "Chicago", 
      "FirstName": "John", 
      "LastName": "Smith", 
      "State": "IL", 
      "Email": "test@test.com", 
      "Fax": "", 
      "Zip": "60001", 
      "Deleted": 0, 
      "Company": "Hostway co", 
      "Phone": "555-555-5501", 
      "ContactType": "administrator", 
      "AccountId": 100144677, 
      "Phone2Clean": "", 
      "MiddleName": "", 
      "Country": "US", 
      "AccountNumber": "test-account11111", 
      "PhoneClean": "5555555501", 
      "Agent": "n/a", 
      "Id": 100429417, 
      "Phone2": "", 
      "Street": "100 Main St.", 
      "Email2": "", 
      "Street2": ""
   },
   {
      "City": "Chicago", 
      "FirstName": "John", 
      "LastName": "Smith", 
      "State": "IL", 
      "Email": "test@test.com", 
      "Fax": "", 
      "Zip": "60001", 
      "Deleted": 0, 
      "Company": "Hostway co", 
      "Phone": "555-555-5501", 
      "ContactType": "technical", 
      "AccountId": 100144677, 
      "Phone2Clean": "", 
      "MiddleName": "", 
      "Country": "US", 
      "AccountNumber": "test-account11111", 
      "PhoneClean": "5555555501", 
      "Agent": "n/a", 
      "Id": 100429418, 
      "Phone2": "", 
      "Street": "100 Main St.", 
      "Email2": "", 
      "Street2": ""
   }
]
 

Request for non-existent account Id

Request

GET /accounts/{fake_account_number}/contacts
Authorization: Basic {Base64-encoded username & password string}
 

Response

404 Not Found

{
   "itemNotFound": {
      "message": "/accounts/fake-account-id/contacts", 
      "code": 404, 
      "details": ""
   }
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox