Resource Definitions:Contacts

From API Documentation

(Difference between revisions)
Jump to: navigation, search
(XML)
Line 65: Line 65:
</source>
</source>
-
==== JSON ====
+
==== JSON Response ====
<source lang="javascript">
<source lang="javascript">
[
[
Line 131: Line 131:
=== Example Request Data ===
=== Example Request Data ===
-
==== XML ====
+
==== XML Request ====
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Line 157: Line 157:
</source>
</source>
-
==== JSON ====
+
==== JSON Request ====
<source lang="javascript">
<source lang="javascript">
{
{
Line 184: Line 184:
</source>
</source>
-
==== TEXT (uri-encoded) ====
+
==== TEXT Request (uri-encoded) ====
<div style="overflow: auto;">
<div style="overflow: auto;">
<source lang="text">
<source lang="text">
Line 193: Line 193:
=== Example Response Data ===
=== Example Response Data ===
-
==== XML ====
+
==== XML Response ====
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Line 203: Line 203:
</source>
</source>
-
==== JSON ====
+
==== JSON Response ====
<source lang="javascript">
<source lang="javascript">
[
[
Line 212: Line 212:
</source>
</source>
-
==== TEXT (pipe-delimited) ====
+
==== TEXT Response (pipe-delimited) ====
<div style="overflow: auto;">
<div style="overflow: auto;">
<source lang="text">
<source lang="text">
Line 225: Line 225:
=== Example Request Data ===
=== Example Request Data ===
-
==== XML ====
+
==== XML Request ====
<source lang="xml">
<source lang="xml">
</source>
</source>
-
==== JSON ====
+
==== JSON Request ====
<source lang="javascript">
<source lang="javascript">
</source>
</source>
-
==== TEXT (uri-encoded) ====
+
==== TEXT Request (uri-encoded) ====
<div style="overflow: auto;">
<div style="overflow: auto;">
<source lang="text">
<source lang="text">
Line 241: Line 241:
=== Example Response Data ===
=== Example Response Data ===
-
==== XML ====
+
==== XML Response ====
<source lang="xml">
<source lang="xml">
</source>
</source>
-
==== JSON ====
+
==== JSON Response ====
<source lang="javascript">
<source lang="javascript">
</source>
</source>
-
==== TEXT (pipe-delimited) ====
+
==== TEXT Response (pipe-delimited) ====
<div style="overflow: auto;">
<div style="overflow: auto;">
<source lang="text">
<source lang="text">
</source>
</source>
</div>
</div>

Revision as of 04:49, 18 July 2010

The contacts resource is a collection of all contacts associated with your agent account.

Example URI: http://api.rezora.com/v1/contacts

Available methods are:

Contents

GET

Returns a list of contacts. Each contact record includes the following fields:

  • contact_id
  • contact_name
  • contact_email
  • contact_type (possible values are: Hot, Active, Inactive, [empty string = no type])
  • contact_title
  • contact_company
  • contact_phone_home
  • contact_phone_work
  • contact_phone_mobile
  • contact_phone_fax
  • contact_business_street
  • contact_business_street2
  • contact_business_city
  • contact_business_state
  • contact_business_zip
  • contact_home_street
  • contact_home_street2
  • contact_home_city
  • contact_home_state
  • contact_home_zip
  • contact_date
  • contact_self

Example Responses

XML Response

<?xml version="1.0" encoding="UTF-8"?>
<contacts version="1.0">
 <contact>
  <contact_id>123456</contact_id>
  <contact_name>Jane Smith</contact_name>
  <contact_email>jane.smith@company.com</contact_email>
  <contact_type>Active</contact_type>
  <contact_title>Consultant</contact_title>
  <contact_company>Acme Consulting</contact_company>
  <contact_phone_home>303-555-1234</contact_phone_home>
  <contact_phone_work>303-555-1235</contact_phone_work>
  <contact_phone_mobile>303-555-1236</contact_phone_mobile>
  <contact_phone_fax>303-555-1237</contact_phone_fax>
  <contact_business_street>123 Church Street</contact_business_street>
  <contact_business_street2>Suite 12</contact_business_street2>
  <contact_business_city>Shady Acres</contact_business_city>
  <contact_business_state>CO</contact_business_state>
  <contact_business_zip>12345</contact_business_zip>
  <contact_home_street>124 Church Street</contact_home_street>
  <contact_home_street2></contact_home_street2>
  <contact_home_city>Shady Acres</contact_home_city>
  <contact_home_state>CO</contact_home_state>
  <contact_home_zip>12345</contact_home_zip>
  <contact_date>2010-07-16 22:34:01</contact_date>
  <contact_self>0</contact_self>
 </contact>
 ...
</contacts>

JSON Response

[
 {
  "contact_id":"123456",
  "contact_name":"Jane Smith",
  "contact_email":"jane.smith@company.com",
  "contact_type":"Active",
  "contact_title":"Consultant",
  "contact_company":"Acme Consulting",
  "contact_phone_home":"303-555-1234",
  "contact_phone_work":"303-555-1235",
  "contact_phone_mobile":"303-555-1236",
  "contact_phone_fax":"303-555-1237",
  "contact_business_street":"123 Church Street",
  "contact_business_street2":"Suite 12",
  "contact_business_city":"Shady Acres",
  "contact_business_state":"CO",
  "contact_business_zip":"12345",
  "contact_home_street":"124 Church Street",
  "contact_home_street2":"",
  "contact_home_city":"Shady Acres",
  "contact_home_state":"CO",
  "contact_home_zip":"12345",
  "contact_date":"2010-07-16 22:34:01",
  "contact_self":"0"
 }
 ...
]

TEXT (pipe-delimited)

contact_id|contact_name|contact_email|contact_type|contact_title|contact_company|contact_phone_home|contact_phone_work|contact_phone_mobile|contact_phone_fax|contact_business_street|contact_business_street2|contact_business_city|contact_business_state|contact_business_zip|contact_home_street|contact_home_street2|contact_home_city|contact_home_state|contact_home_zip|contact_date|contact_self
123456|Jane Smith|jane.smith@company.com|Active|Consultant|Acme Consulting|303-555-1234|303-555-1235|303-555-1236|303-555-1237|123 Church Street|Suite 12|Shady Acres|CO|12345|124 Church Street||Shady Acres|CO|12345|2010-07-16 22:34:01|0
...

POST

Adds a new contact, and returns the new contact ID. You may include the following fields (required fields marked with a red asterisk (*)):

  • contact_name
  • contact_email * (must be unique; if already exists, an error will be returned)
  • contact_type (accepted values are: Hot, Active, Inactive, [empty string = no type])
  • contact_title
  • contact_company
  • contact_phone_home
  • contact_phone_work
  • contact_phone_mobile
  • contact_phone_fax
  • contact_business_street
  • contact_business_street2
  • contact_business_city
  • contact_business_state
  • contact_business_zip
  • contact_home_street
  • contact_home_street2
  • contact_home_city
  • contact_home_state
  • contact_home_zip

Example Request Data

XML Request

<?xml version="1.0" encoding="UTF-8"?>
<data>
 <contact_name>Jane Smith</contact_name>
 <contact_email>jane.smith@company.com</contact_email>
 <contact_type>Active</contact_type>
 <contact_title>Consultant</contact_title>
 <contact_company>Acme Consulting</contact_company>
 <contact_phone_home>303-555-1234</contact_phone_home>
 <contact_phone_work>303-555-1235</contact_phone_work>
 <contact_phone_mobile>303-555-1236</contact_phone_mobile>
 <contact_phone_fax>303-555-1237</contact_phone_fax>
 <contact_business_street>123 Church Street</contact_business_street>
 <contact_business_street2>Suite 12</contact_business_street2>
 <contact_business_city>Shady Acres</contact_business_city>
 <contact_business_state>CO</contact_business_state>
 <contact_business_zip>12345</contact_business_zip>
 <contact_home_street>124 Church Street</contact_home_street>
 <contact_home_street2></contact_home_street2>
 <contact_home_city>Shady Acres</contact_home_city>
 <contact_home_state>CO</contact_home_state>
 <contact_home_zip>12345</contact_home_zip>
</data>

JSON Request

{
 "data":{
  "contact_name":"Jane Smith",
  "contact_email":"jane.smith@company.com",
  "contact_type":"Active",
  "contact_title":"Consultant",
  "contact_company":"Acme Consulting",
  "contact_phone_home":"303-555-1234",
  "contact_phone_work":"303-555-1235",
  "contact_phone_mobile":"303-555-1236",
  "contact_phone_fax":"303-555-1237",
  "contact_business_street":"123 Church Street",
  "contact_business_street2":"Suite 12",
  "contact_business_city":"Shady Acres",
  "contact_business_state":"CO",
  "contact_business_zip":"12345",
  "contact_home_street":"124 Church Street",
  "contact_home_street2":"",
  "contact_home_city":"Shady Acres",
  "contact_home_state":"CO",
  "contact_home_zip":"12345"
 }
}

TEXT Request (uri-encoded)

contact_name=Jane+Smith&contact_email=jane.smith%40company.com&contact_type=Active&contact_title=Consultant&contact_company=Acme+Consulting&contact_phone_home=303-555-1234&contact_phone_work=303-555-1235&contact_phone_mobile=303-555-1236&contact_phone_fax=303-555-1237&contact_business_street=123+Church+Street&contact_business_street2=Suite+12&contact_business_city=Shady+Acres&contact_business_state=CO&contact_business_zip=12345&contact_home_street=124+Church+Street&contact_home_street2=&contact_home_city=Shady+Acres&contact_home_state=CO&contact_home_zip=12345

Example Response Data

XML Response

<?xml version="1.0" encoding="UTF-8"?>
<contacts version="1.0">
 <contact>
  <contact_id>123456</contact_id>
 </contact>
</contacts>

JSON Response

[
 {
  "contact_id":"123456"
 }
]

TEXT Response (pipe-delimited)

contact_id
123456

DELETE

Permanently removes ALL contacts, and returns a success code.

Example Request Data

XML Request

 

JSON Request

 

TEXT Request (uri-encoded)

 

Example Response Data

XML Response

 

JSON Response

 

TEXT Response (pipe-delimited)

 
Personal tools