POST API Details (JSON)
(Last Updated On: April 28, 2016)

Event API details

This page will go over all of the possible fields that may be included within a JSON POST of a support request. If a field does not have data associated with it, then it will not show up within the JSON data.

id: Internal id created by SnapEngage and can be used to reference the specific support request
widget_id: String id of the widget in which the chat took place
url: URL pointing to the details of the support request
snapshot_image_url: URL pointing to the snapshot that is associated with the service request, if one was created
type: Will either be ‘chat’ or ‘offline’, depending on the nature of the service request
requested_by: Email of the person who requested the chat
requester_details: These are details we have gathered about the requester through various online systems.
name: The full name of the requester
emails: An array of email address associated with the requester
name_profile_link: A string containing links to contact profiles associated with the requester
phones: An array of phone numbers associated with the requester
address: Address associated with the requester
address_2: Second address associated with the requester
city: City associated with the requester
state: State associated with the requester
zip: Zip code associated with the requester
country: Country associated with the requester
company_name: Name of the company associated with the requester
company_profile_link: Link to the company profile associated with the requester
employees: A comma separated list of employees associated with the requester
revenue: Company revenue associated with the requester
title: Professional title associated with the requester
website: Website associated with the requester
social_profile_links: An array of links to social profiles associated with the requester (ie. Twitter, Facebook, LinkedIn, etc)
gender: Gender of requester
age: Age of requester
influencer_score: Influencer score associated with the requester
notes: Notes gathered on requester
industry: Industry associated with the requester
avatars: An array of links to avatars associated with the requester
other_data: An array containing any other relevant data associated with the requester
description: The entered description for the support request
created_at_date: Date the support request was created in “MMM d, yyyy h:mm:ss a” format (ie, Oct 3, 2014 2:14:31 PM). Given in GMT.
created_at_seconds: Date the support request was created in seconds since January 1, 1970, 00:00:00 GMT
created_at_milliseconds: The milliseconds of the second that the support request was created. If the creation time was 13:43:25.268 then this value would be 268
proactive_chat: This will either be true or false, depending on if the chat was initiated as a proactive or not
page_url: Specific URL where the support request originated from
referrer_url: URL of the website that the user came from to get to the current site
entry_url: URL of the specific entry point the user came to on the current site
ip_address: IP address of the person initiating the support request
user_agent: Details about the initiating person’s user agent
browser: Specific browser and version information from the support request initiator
os: Specific operating system information from the support request initiator
country_code: Two digit country code for the support request initiator
country: Country for the support request initiator
region: FIPS region code for the support request initiator
city: City name for the support request initiator
latitude: Latitude, is decimal degrees, for the support request initiator
longitude: Longitude, is decimal degrees, for the support request initiator
source_id: Value of 1 when the SnapEngage interaction was a simple message, and of 2 when it was a live chat session
chat_waittime: Wait time, in seconds, between when the support request was initiated and when an agent responded
chat_duration: Duration of the entire support request, in seconds
language_code: Language codes from the support request initiators browser settings
transcripts: An array of transcript objects which are described as;
id: Id of the person who created the message. In the case of the visitor, this will be blank
date: Date the message was created in “MMM d, yyyy h:mm:ss a” format (ie, Oct 3, 2014 2:14:31 PM)
date_seconds: Date the message was created in the number of seconds since January 1, 1970, 00:00:00 GMT
date_milliseconds: The milliseconds of the second that the transcript was created. If the creation time was 13:43:25.268 then this value would be 268
alias: Alias of the person who created the message
message: Contents of the message
plugins: An array of plugin objects which detail any installed plugins within the initiators browser. The plugin data is described as;
name: Name of the plugin
value: Value of the plugin
javascript_variables: An array of javascript variable objects which detail any defined javascript variables within the support request session. The javascript variable data is described as;
name: Name of the javascript variable
value: Value of the javascript variable
operator_variables: An array of operator variable objects which detail any defined operator variables within the support request session. The operator variable data is described as;
name: Name of the operator variable
value: Value of the operator variable

Example

Below is an example support request represented in JSON which includes all of the above fields.

{
    "id": "8b7c3b3b-f5d7-4e58-96d8",
    "widget_id": "e8175843-d381-4d7c-aa9f-0da1610ad1b",
    "url": "https://www.snapengage.com/viewcase?c=8b7c3b3b-f5d7-4e58-96d8",
    "snapshot_image_url": "https://www.snapengage.com/snapabug/ServiceImage?c=8b7c3b3b-f5d7-4e58-96d8",
    "type": "chat",
    "requested_by": "test@test.com",
    "requester_details":
      {
        "name": "Jim Tester",
        "emails": ["test@example.com"],
        "name_profile_link": "http://facebook.com/jimtester",
        "phones": ["555-555-1010"],
        "address": "111 2nd Ave.",
        "address_2": "",
        "city": "Boulder",
        "state": "CO",
        "zip": "80303",
        "country": "US",
        "company_name": "SnapEngage",
        "company_profile_link": "http://facebook.com/snapengage",
        "employees": "Abe,Betty,Charlie",
        "revenue": "100",
        "title": "CEO",
        "website": "www.snapengage.com",
        "social_profile_links": ["www.facebook.com/jimatsnapengage","www.twitter.com/jimtesteratsnap"],
        "gender": "Male",
        "age": 44,
        "influencer_score": "88.8",
        "notes": "This is just for testing",
        "industry": "Tech",
        "avatars": ["http://www.avatars.com/jimtester"],
        "other_data": []
      },
    "description": "Testing the Open API...",
    "created_at_date": "Oct 3, 2014 2:14:31 PM",
    "created_at_seconds": 1412367271,
    "created_at_milliseconds": 268,
    "proactive_chat": false,
    "page_url": "http://www.snapengage.com/demo/postapi.html",
    "referrer_url": "http://www.comingfromurl.com",
    "entry_url": "http://www.yoursite.com",
    "ip_address": "67.174.108.196",
    "user_agent": "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0,gzip(gfe)",
    "browser": "Chrome (3.0.195.27)",
    "os": "Microsoft Windows Vista",
    "country_code": "US",
    "country": "United States",
    "region": "16",
    "city": "Boulder",
    "latitude": 39.914700,
    "longitude": -105.080902,
    "source_id": 2,
    "chat_waittime": 2,
    "chat_duration": 15,
    "language_code": "en-US,en;q=0.8",
    "transcripts": [
      {
        "id": "",
        "date": "Oct 3, 2014 2:14:31 PM",
        "date_seconds": 1412367271,
        "date_milliseconds": 154,
        "alias": "visitor",
        "message": "Hello, "
      },
      {
        "id": "jerome@snapengage.com",
        "date": "Oct 3, 2014 2:14:31 PM",
        "date_seconds": 1412367271,
        "date_milliseconds": 456,
        "alias": "test",
        "message": "Hi, "
      },
      {
        "id": "",
        "date": "Oct 3, 2014 2:14:31 PM",
        "date_seconds": 1412367271,
        "date_milliseconds": 835,
        "alias": "visitor",
        "message": "This is a test."
      }
    ],
    "plugins": [
      {
        "name": "Java",
        "value": "1.2.3"
      }, {
        "name": "Flash",
        "value": "3.4.5"
    }],
    "javascript_variables": [{
        "name": "variable1",
        "value": "v1_1234"
    }, {
        "name": "variable2",
        "value": "v2_123456789"
    }],
    "operator_variables": [{
        "name": "note",
        "value": "this is a note entered by the agent"
    }, {
        "name": "customerTemp",
        "value": "Very Happy"
    }]
}


Additional information

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 JSON content is a stream in JSON format. You can not access this stream in the $_* variables of PHP. Please use this instead:

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