API: Contacts
A Contact resource represents information about a managed advertiser i.e. an individual or company who doesn't use the self-service interface and whose campaigns are created and managed by the publisher.
Supported Methods
| URI | GET | POST | PUT | DELETE |
|---|---|---|---|---|
| /resources/contacts/ | List | Create | - | - |
| /resources/contacts/<contact_id>.<format> | Read | - | Update | Delete |
List contacts
- URL -
http://<subdomain>.trafficspaces.com/resources/contacts/ - Method -
GET - Parameters -
- page - (unsigned, optional) an integer value that specifies which page of results to fetch, starting at 1. Default: 1. Minimum: 1.
- pagesize - (unsigned, optional) how many results to fetch in each request. Default: 25. Maximum: 100
- Response
- Status -
200, if successful. - Body - A collection of up to pagesize contacts in the requested format
- Status -
Read a contact
- URL -
http://<subdomain>.trafficspaces.com/resources/contacts/<contact_id>.<format> - Method -
GET - Parameters - None
- Response
- Status -
200, if successful. - Body - The requested contact in the requested format
- Status -
Create a new contact
- URL -
http://<subdomain>.trafficspaces.com/resources/contacts/ - Method -
POST - Parameters - XML or JSON data. See the Attributes below
- Response
- Status -
201, if successful. - Body - The created contact in the requested format
- Headers
- Location - A relative URL for the newly created contacts
- Status -
Update an existing contact
- URL -
http://<subdomain>.trafficspaces.com/resources/contacts/<contact_id>.<format> - Method -
PUT - Parameters - XML or JSON data. See the Attributes below
- Response
- Status -
200, if successful. - Body - The updated contact in the requested format
- Status -
Delete an existing contact
- URL -
http://<subdomain>.trafficspaces.com/resources/contacts/<contact_id>.<format> - Method -
DELETE - Parameters - None
- Response
- Status -
200, if successful.
- Status -
Attributes
- contact - (object, rwa)
- id - (string, r) the alphanumeric unique identifier
- name - (string, rwa) the display name in the ad store.
- realm - (string, r) the subdomain name of the ad store
- creation_date - (datetime, r) the date on which the contact was created.
- last_modified_date - (datetime, r) the date on which the contact was last modified.
- linked_user - (object, rw)
- id - (string, rw) the alphanumeric unique identifier of the user that created the contact
- name - (string, r) the username of the user that created the contact
- profile - (object, rwa, optional)
- reference - (string, rwa, optional) the publisher-specific reference code for the contact
- email - (string, rwa, optional) the contact's email address
- company_name - (string, rwa, optional) the name of the contact's organisation
- website - (string, rwa, optional) the contact's website
- type - (unsigned, rw) denotes what kind of
contact it is. Valid values include
- 0 - Managed Advertiser
- contact_details - (object, rwa, optional)
- street - (string, rwa, optional) the first line of the contact's street address
- street2 - (string, rwa, optional) the second line of the contact's street address
- city - (string, rwa, optional) the contact's city name
- state - (string, rwa, optional) the contact's state name
- zip - (string, rwa, optional) the contact's zip or postal code
- country - (string, rwa, optional) the contact's country code
- mobile - (string, rwa, optional) the contact's mobile phone number
- telephone - (string, rwa, optional) the contact's telephone number
- fax - (string, rwa, optional) the contact's fax number
Examples
Contact - JSON
{
"id": "150a6666",
"name": "Chris Parks",
"realm": "fresh",
"linked_user": {
"id": "0937111d0e6b33150a0e6f66",
"name": "admin@mywebsite.com"
},
"profile": {
"reference": "ABC123",
"email": "chris@cpconsulting.com",
"company_name": "Chris Parks Consulting",
"website": "http://www.cpconsulting.com",
"type": 0,
"contact_details": {
"street": "15 Tunbridge Square, Mayfair",
"street2": "",
"city": "London"
"state": "Greater London",
"zip": "WC4 2GH",
"country": "gb",
"mobile": "0208 678 2421",
"telephone": "",
"fax": ""
}
},
"creation_date": "2010-11-15T19:27:27",
"last_modified_date": "2010-11-15T19:27:27"
}
Contact - XML
<?xml version="1.0" encoding="UTF-8"?>
<contact>
<id>150a6666</id>
<name>Chris Parks</name>
<realm>demo</realm>
<linked_user>
<id>0937111d0e6b33150a0e6f66</id>
<name>admin@mywebsite.com</name>
</linked_user>
<profile>
<reference>ABC123</reference>
<email>chris@cpconsulting.com</email>
<company_name>Chris Parks Consulting</company_name>
<website>http://www.cpconsulting.com</website>
<type>0</type>
<contact_details>
<street>15 Tunbridge Square, Mayfair</street>
<street2></street2>
<city>London</city>
<state>Greater London</state>
<zip>WC4 2GH</zip>
<country>gb</country>
<mobile>0208 678 2421</mobile>
<telephone></telephone>
<fax></fax>
</contact_details>
</profile>
<creation_date>2010-11-15T19:27:27</creation_date>
<last_modified_date>2010-11-15T19:27:27</last_modified_date>
</contact>