Accounts-accountId-Contacts-contactType:GET
From Hostway API Documentation
Revision as of 11:49, 20 August 2014 by Mike.robski (Talk | contribs)
GET /accounts/{accountId}/contacts/{contactType}
Get specific contact type for an account
Contents |
Request
GET /accounts/{accountId}/contacts/{contactType}
Request Parameters
- accountId - string
- The unique account Id.
- contactType - string
- Contact type. One of 'regular', 'billing', 'administrator', 'technical'
URI Parameters
None.
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
Response
Status Code
- 200 OK
- Success
- 401 Unauthorized
- The request was sent without an Authorization header, or the user represented by the value of this header was not properly authenticated.
- 403 Forbidden
- The user authenticated for this request is not allowed to access the resource.
- 404 Not Found
- Contact type does not match allowed values or the specified account Id does not exist or is purged.
Response Body
{ "city": "Chicago", "company": "Widget Corp.", "countryCode": "US", "email1": "test@test.com", "email2": "", "emailVerified": 1, "fax": "", "firstName": "John", "lastName": "Smith", "middleName": "", "phone1": "555-555-5501", "phone2": "", "postalCode": "60001", "salutation": "Mr.", "stateOrProvince": "IL", "street1": "100 Main St.", "street2": "" }
Parameters
- city - string
- May be up to 50 characters long. May contain only alphanumeric, white space and the following characters: -.'
- company - string
- (OPTIONAL)
- May be up to 200 characters long. May contain only alphanumeric, white space and the following characters: -.'
- countryCode - string
- ISO 3166-1 alpha-2[2] country code.
- email1 - string
- May be up to 100 characters long. Must contain a valid e-mail address.
- email2 - string
- (OPTIONAL)
- May be up to 100 characters long. If provided, must contain a valid e-mail address.
- emailVerified - integer
- Provides information whether the email is verified for a Zendesk access. Valid values are 0 or 1.
- fax - string
- (OPTIONAL)
- May be up to 20 characters long. If provided, must contain ITU-T E.164[3] formatted phone number.
- firstName - string
- May be up to 50 characters long. May contain only alphanumeric, white space and the following characters: -.'
- lastName - string
- May be up to 50 characters long. May contain only alphanumeric, white space and the following characters: -.'
- middleName - string
- (OPTIONAL)
- May be up to 50 characters long. If provided, may contain only alphanumeric, white space and the following characters: -.'
- phone1 - string
- May be up to 20 characters long. Must contain ITU-T E.164[4] formatted phone number.
- phone2 - string
- (OPTIONAL)
- May be up to 20 characters long. If provided, must contain ITU-T E.164[5] formatted phone number.
- postalCode - string
- (OPTIONAL)
- May be up to 30 characters long. May contain only alphanumeric, white space and the following characters: -.' This value is *required* if the value of countryCode is "US" or "CA". If the value of countryCode is "US", then postalCode must be in format "#####" or "#####-####" (where "#" represents any numeric digit). If the value of countryCode is "CA", then postalCode must be in format "A#A#A#" or "A#A-#A#" or "A#A #A#" (where "A" represents any latin alphabet character and "#" represents any numeric digit).
- salutation - string
- (OPTIONAL)
- May contain one of the salutations provided by GET /salutations
- stateOrProvince - string
- (OPTIONAL)
- May be up to 20 characters long. May contain only alphanumeric, white space and the following characters: -.' This value is *required* if the value of countryCode is "US" or "CA". If the value of countryCode is "US", then stateOrProvince must be a valid two-letter US state abbreviation. If the value of countryCode is "CA", then stateOrProvince must be a valid two-letter Canadian province abbreviation.
- street1 - string
- May be up to 100 characters long. May contain only alphanumeric, white space and the following characters: -.'
- street2 - string
- (OPTIONAL)
- May be up to 100 characters long. If provided, may contain only alphanumeric, white space and the following characters: -.'
Examples
Successful Request
Request
GET /accounts/{accountId}/contacts/regular Authorization: Basic {Base64-encoded username & password string}
Response
200 OK { "city": "Chicago", "company": "TestCo, Inc.", "countryCode": "US", "email1": "test@test.com", "email2": "", "emailVerified": 1, "fax": "", "firstName": "John", "lastName": "Smith", "middleName": "", "phone1": "555-555-5501", "phone2": "", "postalCode": "60001", "salutation": "Mr.", "stateOrProvince": "IL", "street1": "100 Main St.", "street2": "" }
Request for non-existent contact type
Request
GET /accounts/{accountId}/contacts/fake Authorization: Basic {Base64-encoded username & password string}
Response
404 Not Found { "itemNotFound": { "guid": {identifier}, "message": "Resource not found", "code": 404, "details": "" } }
See also