Searching for Events

CTC has a powerful structured search feature. Events include many searchable properties to query with the POST /events/search endpoint.

Searchable Event Properties

Search for events using the properties returned by the GET /events/searchableproperties endpoint. Here is an example result from the searchableProperties endpoint:

{
  "response": {
    "searchableProperties": {
      "deviceEsn (string[])": "",
      "eventType (string[])": "",
      "accountId (long[])": "",
      "deviceId (long[])": "",
      "mobileId (string[])": "",
      "msgType (string[])": "",
      "created (date[])": "",
      "mobileIdTypeString (string[])": "",
      "eventTime (date[])": "",
      "assetId (long[])": ""
    },
  }
}

Search Object

The body of the POST /events/search query contains a search object. The search object defines the number of results to return in the maxResults parameter, search terms that determine the constraints of the search, and, optionally, sorting parameters. The following is an example of a search object:

{
  "search" : {
    "maxResults": 100,
    "searchTerms": {
      "accountId":4870,
      "created" :"[2020-09-11T00:00:00Z TO 2020-09-20T00:00:00Z]"
    }
  }
}

For more information on structured search, see the "Structured Search" section of CTC API Convention (under Getting Started) in the developer portal.