Accounts-account-email-domain-contacts:POST

From Hostway API Documentation
Jump to: navigation, search

POST /accounts/{account}/email/{domain}/contacts

Creates global address book contact for domain

Contents


Request

POST /accounts/{account}/email/{domain}/contacts

URI Parameters

account - string
domain - string

Request Headers

Authorization - HTTP Authorization header [1]
The Authentication credentials of the client application.
Content-Type
Required. Set this header to application/json; charset=UTF-8


Request Body

{
    "name": "{name}", 
    "email": "{email}", 
    "firstName": "{firstName}", 
    "lastName": "{lastName}", 
    "displayName": "{displayName}"
    "title": "{title}",
    "homePhone": "{homePhone}",
    "mobilePhone": "{mobilePhone}",
    "businessPhone": "{businessPhone}",
    "businessFax": "{businessFax}",
    "isdnNumber": "{isdnNumber}",
    "pager": "{pager}",
    "telexNumber": "{telexNumber}",
    "company": "{company}",
    "department": "{department}",
    "roomNumber": "{roomNumber}",
    "streetAddress": "{streetAddress}",
    "postalCode": "{postalCode}",
    "city": "{city}",
    "state": "{state}",
    "country": "{country}"
}
 

Parameters

name - string
The name of global address book contact. Required.
email - string
The email of global address book contact. Required.
firstName - string
The first name of global address book contact.
lastName - string
The last name of global address book contact.
displayName - string
The display name of global address book contact. Required.
title - string
The title of global address book contact person.
homePhone - string
The home phone of global address book contact.
mobilePhone - string
The home phone of global address book contact.
businessPhone - string
The business phone of global address book contact.
businessFax - string
The business fax of global address book contact.
isdnNumber - string
The isdn number of global address book contact.
pager - string
The pager of global address book contact.
telexNumber - string
The telex number of global address book contact.
company - string
The company name of global address book contact.
department - string
The department name of global address book contact.
roomNumber - string
The room number of global address book contact.
streetAddress - string
The street address of global address book contact.
postalCode - string
The postal code of global address book contact.
city - string
The city name of global address book contact.
state - string
The state name of global address book contact.
country - string
The country name of global address book contact.

Response

Status Code

204 No Content
Success
400 Bad Request
The format of the request body is invalid or the parameters don't meet the requirements.
401 Unauthorized
The supplied credentials are invalid or do not provide permissions for this operation.
409 Conflict
The global address book contact already exists.

Examples

Failure creating global address book contact because of missing data

Request

POST https://api.hostway.com/accounts/account007/email/test-domain.com/contacts

{}
 

Response

400 Bad Request

{
    "displayName": "Required", 
    "name": "Required", 
    "email": "Required"
}
 

Failure creating global address book contact because of erroneous data

Request

POST https://api.hostway.com/accounts/account007/email/test-domain.com/contacts

{
    "name": "test-contact", 
    "email": "test", 
    "displayName": "Display Name"
}
 

Response

400 Bad Request

{
    "email": "Invalid email address"
}
 

Success creating global address book contact

Request

POST https://api.hostway.com/accounts/account007/email/test-domain.com/contacts

{
    "name": "test-contact", 
    "email": "test@test.com", 
    "firstName": "First", 
    "lastName": "Last", 
    "displayName": "Display Name"
}
 

Response

204 No Content
 

Failure creating contact because contact with the same name already exists

Request

POST https://api.hostway.com/accounts/account007/email/test-domain.com/contacts

{
    "name": "test-contact", 
    "email": "test@test.com", 
    "firstName": "First", 
    "lastName": "Last", 
    "displayName": "Display Name"
}
 

Response

409 Conflict

{
    "conflict": {
        "guid": "af4f4c85-4c8f-4c63-95d1-f3fb8cb8c479", 
        "code": 409, 
        "message": "Data conflict"
        "details": ""
    }
}
 

See also

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox