POST API Details (XML)
(Last Updated On: October 7, 2014)

Event API details

When the API is activated and a new contact request is received, SnapEngage will automatically send a POST transaction to the URL specified in the API configuration. The transaction provides details about the request in an XML format.

POST event details:

<?xml version="1.0" encoding="UTF-8"?>

  <description><![CDATA[Testing the Open API...]]></description>
  <created_at type="datetime">2010-10-18T01:48:18.623Z</created_at>
  <browser>Chrome (6.0.472.63)</browser>
  <os>Microsoft Windows 7</os>
  <country>United States</country>
  <source_id type="integer">2</source_id>

  <languages type="array">

  <plugins type="array">

  <javascript_variables type="array">

  <operator_variables type="array">
     <value><![CDATA[this is a note entered by the agent]]></value>

  <transcripts type="array">
      <date type="datetime">Mon Oct 18 01:48:27 UTC 2010</date>
      <message>Hello, </message>
      <date type="datetime">Mon Oct 18 01:48:32 UTC 2010</date>
      <date type="datetime">Mon Oct 18 01:48:41 UTC 2010</date>
      <message>This is a test.</message>
      <date type="datetime">Mon Oct 18 01:48:49 UTC 2010</date>
      <message>ok. thank's for testing. </message>

  <chat_waittime type="integer">2</chat_waittime>
  <chat_duration type="integer">15</chat_duration> 


Additional information

source_id: The tag source_id has an integer value of 1 when the SnapEngage interaction was a simple offline message, and 2 when it was a live chat session.

retries: The target system needs to respond with and HTTP 200 to confirm that the event has been received and processed. In the absence of a successful HTTP response, SnapEngage will retry the HTTP POST automatically for approximately 2 hours before sending it through email and flagging the event as sent.

using PHP: The XML content is a stream in XML format. You can not access this stream in the $_* variables of PHP. Please use this instead:

$xml = fopen("php://input","r");