API:Contacts
From Aligni Wiki
Contents |
[edit]
List
Command: GET /contact
Description: Retrieve the list of all contacts.
Request/Response:
<contacts>
<contact>
...
</contact>
<contact>
...
</contact>
</contacts>
[edit]
Show
Command: GET /contact/#{contact_id}
Description: Retrieve one particular contact by its id.
Request/Response:
<contact> ... </contact>
[edit]
Create
Command: POST /contact
Description: Create a new contact.
Request/Response:
<contact>
<first_name>#{first_name}</first_name>
<last_name>#{last_name}</last_name>
<email>#{email}</email>
<phone1>#{phone1}</phone1>
<phone2>#{phone2}</phone2>
<phone3>#{phone3}</phone3>
<address1>#{address1}</address1>
<address2>#{address2}</address2>
<address3>#{address3}</address3>
<postcode>#{postcode}</postcode>
<city>#{city}</city>
<state>#{state}</state>
<country>#{country}</country>
<vendor_id>#{vendor_id}</vendor_id>
</contact>
<contact> ... </contact>
[edit]
Update
Command: PUT /contact/#{contact_id}
Description: Updates a contact record.
Request/Response:
<contact>
<first_name>#{first_name}</first_name>
<last_name>#{last_name}</last_name>
<email>#{email}</email>
<phone1>#{phone1}</phone1>
<phone2>#{phone2}</phone2>
<phone3>#{phone3}</phone3>
<address1>#{address1}</address1>
<address2>#{address2}</address2>
<address3>#{address3}</address3>
<postcode>#{postcode}</postcode>
<city>#{city}</city>
<state>#{state}</state>
<country>#{country}</country>
<vendor_id>#{vendor_id}</vendor_id>
</contact>
<contact> ... </contact>
[edit]
Delete
Command: DELETE /contact/#{contact_id}
Description: Delete a contact by its id.
Request/Response: None
[edit]
Sample Record
<contact> <id>4</id> <first_name>Jim</first_name> <last_name>Milspec</last_name> <email>jim@milspec.notreal</email> <phone1>1-916-555-1212</phone1> <phone2></phone2> <phone3></phone3> <address1>1234 Machining Lane</address1> <address2></address2> <address3></address3> <postcode>12345</postcode> <city>Pleasantville</city> <state>New Jersey</state> <country>USA</country> <created_on>Sat Jan 14 04:00:14 UTC 2006</created_on> <updated_on>Thu Dec 14 06:30:29 UTC 2006</updated_on> <vendor_id>51</vendor_id> </contact>
