Add / Update Ticket API using POST XML November 2010 ZebraCRM system allows adding and updating system tickets by external sites. The API accepts ticket data in XML format as specified. Indication of success or failure will be returned in XML format. Errors will also be listed in the XML response. For secure and safe usage, the API requires a valid ZebraCRM System Number, username and password. Every XML file sent by the external website will update the ZebraCRM with the ticket details attached. Every XML file can add/update only one ticket. Each add/update XML file can contain several ticket details. Target URLs for sending the XML DATA file, using POST protocol. New Ticket Add URL : http://(system Number).zebracrm.com/ext_interface.php?b=add_customer Ticket Update URL http://(system Number).zebracrm.com/ext_interface.php?b=update_customer Card data will be sent in XML format using POST method XML structure detailed information in xml_explanation.xls. API XML Example file in xml_client.ex.php. Choosing the relevant ticket type when using add new ticket API The ZebraCRM system contains different ticket types. When you send "add a new ticket" XML file, you need to choose the relevant ticket type you want to add. Common ticket types used by most ZebraCRM systems : business_customer, private_customer, supplier, market_activity, market_factor updating data in existing tickets When using the update ticket API, the XML file must specify the ticket ID to update. The API can detect the relevant ticket to update using several different identification fields. The update ticket XML file should specify which field is used for ticket identification using the IDENTIFIER tag..
Using ticket information tags Data insertion to different fields in the new or existing ticket is done by using field ID tags. Each field ID is specified in the advanced configuration menu in the ZebraCRM system. Data Formats used by different field types ZebraCRM uses several field types which requires different Data formats. Here are the Different Data formats used by the different field types : Number number Text text Date - dd / mm / yyyy CheckBox - 0 / 1 List - textual list values (no record ID needed) Multiple lists textual list values separated by commas (,) no value chosen will be marked as 0. email updates When the mail server information is set correctly in the system, the system sends automatic email response to administrators. Additional E-mails can be sent using the SEND_MAIL tag containing a list of emails recipients. Here's an example for adding a new ticket with several details: <?xml version="1.0" encoding="utf-8"?> <PERMISSION> <USERNAME>manager</USERNAME> //valid Zebracrm username <PASSWORD>1234</PASSWORD> // valid password </PERMISSION> <CARD_TYPE>business customer</card_type> // ticket type to add - (used only for add a new ticket API) <CUST_DETAILS>//new ticket information : update < ORGNAME >ICOM Software LTD</ ORGNAME > // organization name. < MAIL >user@zebracrm.com</ MAIL >// organization email address. < CELL >050-5555555</ CELL >// organization cellular phone number. < STATE >ISRAEL</ STATE >// organization state. < CITY >Petah Tikva</ CITY >// organization city. < STREET >Hamagshimim</ STREET >// organization street. < NUM >18</ NUM >// organization house number. < POB >7554</ POB >// organization POB. < ZIP >49250</ ZIP >// organization ZIP code. < FREE_TEXT >Second floor on the left</ FREE_TEXT > < CREDIT_NUMBER >88885555</ CREDIT_NUMBER > / / Credit card number </ CUST_DETAILS > < SEND_MAIL > < MAIL >contact@zebracrm.com</ MAIL > / / Email recipients for status </ SEND_MAIL >
Here's an example for updating an existing ticket: <?xml version="1.0" encoding="utf-8"?> <PERMISSION> <USERNAME>manager</USERNAME> // valid Zebracrm username <PASSWORD>1234</PASSWORD> // valid password </PERMISSION> <IDENTIFIER >MAIL</IDENTIFIER > // Dedicated system tag for choosing field identification for update. Choosing mail in identifier tag means that the system will look for the ticket containing the Data specified in the MAIL tag and update that ticket data accordingly <CUST_DETAILS>// ticket information: < ORGNAME >Hagit</ ORGNAME > // organization name data. < MAIL >contact@zebracrm.com</ MAIL >// organization email data (in this example, this tag will be used for ticket identification. The system will update the existing ticket added in the previous example with new data) < ZIP >74740</ ZIP > / / Customer zip code. < GEN >female </ GEN > / /gender data </ CUST_DETAILS > < SEND_MAIL > < MAIL >Ronen200@gmail.com</ MAIL > / / Email Email recipients for status update </ SEND_MAIL >
API XML response contains update statuses: Parameter name Description code Success code or Error code msg Status Details identifier Identifier details errors errort details Success and error codes Table : Code number Description 0 ADD CUSTOMER SUCCESSFULLY 0 UPDATE CUSTOMER SUCCESSFULLY 1 NO DATA (File received is not a valid XML file) 2 CAN NOT CREATE USER 3 CAN NOT CREATE CONTACT 4 INVALID XML 5 INCORRECT NAME OR PASSWORD 6 DATE IS NOT IN FORMAT dd/mm/yyyy 7 NO ADDRESS DETAILS 8 CAN NOT ADD NEW OBJ TO USERS PROPS 9 VALUE NOT FOUND IN PROPERTY 10 CAN NOT ADD NEW OBJ TO USERS PROPS IN 11 CAN NOT FOUND OBJS PROPS TYPES 12 FAILD TO ADD OBJ PROP 13 NOT FOUND PROPERTY 15 CLIENT IDENTIFIER ERROR 16 NOT FOUND USER
Here's an example of API XML response: Action successful; <code>0</code> <identifier>48</identifier> <msg>update CUSTOMER SUCCESSFULLY 48</msg> Action Failure: <code>4</code> <msg>invaild XML</msg> Action partial success: <code>0</code> <identifier>48</identifier> <msg>update CUSTOMER SUCCESSFULLY 48</msg> <errors> <error> <code>9</code> <msg>value NOT FOUND IN PROPERTY ARA</msg> </error> </errors>