Below is a request to view all the companies :
curl -u {youremail}:{password} http://{yourhelpdesk.freshdesk.com}/customers.xml
Below is the sample output for the above request:
<?xml version="1.0" encoding="UTF-8"?>
<customers type="array">
<customer>
<created-at type="datetime">2011-11-13T22:56:16+05:30</created-at>
<cust-identifier nil="true"></cust-identifier>
<description nil="true"></description>
<domains type="yaml" nil="true"></domains>
<id type="integer">1</id>
<name>Freshdesk</name>
<note nil="true"></note>
<sla-policy-id type="integer">1</sla-policy-id>
<updated-at type="datetime">2011-11-13T22:56:16+05:30</updated-at>
</customer>
</customers>
Below is a request to view a particular company :
curl -u {youremail}:{password}
http://{yourhelpdesk.freshdesk.com}/customers/{id}.xml
Below is the sample output for the above request:
<?xml version="1.0" encoding="UTF-8"?> <customer> <created-at type="datetime">2011-11-13T22:56:16+05:30</created-at> <cust-identifier nil="true"></cust-identifier> <description nil="true"></description> <domains type="yaml" nil="true"></domains> <id type="integer">1</id> <name>Freshdesk</name> <note nil="true"></note> <sla-policy-id type="integer">1</sla-policy-id> <updated-at type="datetime">2011-11-13T22:56:16+05:30</updated-at> </customer>
Below is a sample POST request for creating a Company
curl -u {username}:{password} -H "Content-Type: application/xml" -d
"<customer><name>{CompanyName}</name></customer>" -X POST
http://{yourhelpdesk.freshdesk.com}/customers.xml
Below is the sample output for the above request:
<?xml version="1.0" encoding="UTF-8"?> <customer> <created-at type="datetime">2011-11-13T23:10:14+05:30</created-at> <cust-identifier nil="true"></cust-identifier> <description nil="true"></description> <domains type="yaml" nil="true"></domains> <id type="integer">3</id> <name>Google</name> <note nil="true"></note> <sla-policy-id type="integer">1</sla-policy-id> <updated-at type="datetime">2011-11-13T23:10:14+05:30</updated-at> </customer>
Below is a sample PUT request for modifying a Company
curl -u {username}:{password} -H "Content-Type: application/xml" -d
"<customer ><name>{CompanyName}</name></customer>" -X PUT
http://{yourhelpdesk.freshdesk.com}/customers/{id}.xml
Below is a sample DELETE request for deleting a Company
curl -u {username}:{password} -X DELETE
http://{yourhelpdesk.freshdesk.com}/customers/{id}.xml