Skip to main content

Leverage APIs to gain customer activity insight (SAP KC)

The Support Agent Customer Activity API lets users obtain intelligence about the actions that a customer has been performing up to a given point in time.

Customer Activity Report

To set this up requires little configuration (as long as you have the right roles). This feature is already built into the product, to access it all you need to do is go to:

You can browse to that page directly and manually enter your agent id or you can add the parameter


Adding these parameters will automatically load the user reports for the provided user.

The REST end-point


  • The token is one of three possible values
    • A numeric MindTouch user id, ex: 123
    • A MindTouch user name (prefixed with an equals sign), ex: =sherlockh
    • A customer activity token, ex: 1:15c92a8e-c9f7-4aeb-baa9-7b2ea6a25183
      • ​​The customer activity token is generated and sent by MindTouch through the Genius Link workflow
  • The user events will be ordered from newest to oldest in the events document in XML or in the event array  on JSON.
  • Regular users can only see their own activity, administrator users and users with the USERHISTORY permission can see the activity of any user.
  • The Content-Type of the response from this API end point is XML or JSON.
  • By default the response will be XML. If the request includes the dream.out.format=json query parameter, the response will be in JSON.

How to create a Support Agent Customer Activity API enabled group

  • Create a role that includes the USERHISTORY permission through the MindTouch REST API .

with payload:

  • Create  a group in the control panel that grants that role to its members
  • Add the users that you want to allow to view customers' activity to that group.

Support Agent Customer Activity API query parameters

  1. limit The end point will return the last ten user activity items by default. If you need more, you can use the limit query parameter to specify how many would you like to get. The maximum number of user activity items that can be retrieved is 500.
  2. upto If you need to paginate through user activity use this query parameter with the value of the since field from the last response you got, and keep doing it to keep going backwards until no more user activity items are found (meaning there won't be a since field in the response).
  3. include This query parameter can be a comma separated value of elements you'd like to expand. Can include: 'user', 'page', and 'request'. Defaults to empty.

Sample request to the Support Agent Customer Activity API

  • Using an API key:
curl -H "X-ApiKey: key" https://hostname/@api/deki/events/support-agent/1:15c92a8e-c9f7-4aeb-baa9-7b2ea6a25183
  • Using regular user authentication:
curl -u admin:thepassword https://hostname/@api/deki/events/support-agent/1:15c92a8e-c9f7-4aeb-baa9-7b2ea6a25183?dream.out.format=json

Events that we track

  1. Page view
  2. Search

The responses per event type

Page views


<events count="10" upto="958255aa-b779-11e2-aa95-010018ccb3de" since="b61f17b4-b777-11e2-b457-01008eb7436a">
  <event id="958255aa-b779-11e2-aa95-010018ccb3de" datetime="2013-05-08T00:52:40Z" type="page:view">
    <request id="958255aa-b779-11e2-aa95-4cc0be9481b9"/>
    <page id="7182">


           "@datetime":"Wed, 08 May 2013 00:52:40 GMT",



<event id="3611e56e-b778-11e2-ae25-01000be352bd" datetime="2013-05-08T00:42:50Z" type="user:search">
  <request id="3611e56e-b778-11e2-ae25-b3e32b1ece82"/>


  "event":[{ "@id": "3611e56e-b778-11e2-ae25-01000be352bd",
             "@datetime": "Wed, 08 May 2013 00:42:50 GMT",
             "@type": "user:search",
             "data": {
                "_name": "action:search",
                "constraint": "+(+namespace:main)",
                "query": "foo",
                "userId": "6"
            "request": {
                "@id": "3611e56e-b778-11e2-ae25-b3e32b1ece82"

Expanding the information about user, page, and request in the Support Agent Customer Activity API

In case the default response for the different events is not rich enough, you can use the include query parameter to obtain more information about the user, page, and request. For example:

Expand user information


Yields the inclusion of the following user information in the response:

<user id="1" href="https://hostname/@api/deki/users/1">
  <password exists="true"/>
  < owner="true">true</>

Expand page information


Yields the inclusion of the following page information in the response:

<page id="22" href="https://hostname/@api/deki/pages/22?redirects=0" deleted="false">
  <path type="fixed"/>

Expand request information


Yields the inclusion of the following request information in the response:

<request id="7fabbe56-b77e-11e2-96fe-06e8526e3a4e" seq="1">
  <user id="1" anonymous="false"/>
  • Was this article helpful?