Get All Logs
(Last Updated On: April 28, 2017)
Overview

GET /api/v2/{orgId}/logs

This endpoint retrieves all logs for the widget specified by the users, or all logs for all widgets the user has access to, if no widget is specified.

HTTP Request

GET https://www.snapengage.com/api/v2/{org_id}/logs


Query Parameters

orgId
The ID of your organization. (Required)
widgetId
The list of all IDs of the widget to return logs for. If not specified, all widgets the user has access to will be returned.
timezone
The timezone requested. If not specified, “Etc/UTC” will be used as the default.
(default)
 “Etc/UTC”
start
The ISO8601 date to start returning logs from. (Required)
end
The ISO8601 date to stop returning logs from. (Required)
next
If more than 100 results are returned, a value for linkToNextSetOfResults will be returned that can be used to access the next set of results. Otherwise, this parameter is not specified.

**Note that this capability only works when specifying a single widgetId, multiple widgetIds are not currently supported**

Example Usage

curl "https://www.snapengage.com/api/v2/{org_id}/logs?widgetId={widget_id}&start=2017-04-20&end=2017-04-28" -H "Authorization: api_token"
The above command returns JSON structured like this:


Special Notes about Return Data

Most of the returned data is pretty self-explanatory. However some of the data may need some additional explanation, which is below.

survey_score and survey_comments  You will see a survey score for a chat case if a widget has the survey enabled, and if the visitor has chosen to rate the agent at the end of the chat. When a chat ends, we wait 5 minutes before storing the survey data, and the survey actually may stay open on the visitor’s browser for any extended amount of time, which means that the survey score and comments may be stored to the case long after the end time of the chat. This is important because if you are querying the Logs API to return survey data for your chat agents, you should wait a minimum of 5 minutes after the close of a chat before expecting to see survey data for that chat.