Reports API Version 2 Triggers

Introduction

A trigger represents a single tracked event in Infinity. Triggers can be made up of Online and Offline events, such as web site page views or calls. Triggers can be exported from Infinity as a list with various filters applied.

Triggers List

Lists the triggers within an IGRP with the following predefined filtered reports:

Get all triggers

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/all

Get all call triggers ( where trigger action is call )

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/calls

Get all Hosted PBX Call User triggers ( where trigger action is callUser )

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/users

Get all goal triggers ( where trigger is marked as a goal )

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/goals

Get all transaction triggers ( where trigger has transaction currency or goal currency fields ). callRate triggers are excluded from these reports

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/transactions

Get all triggers with any transaction, call or goal details. This is a union of the three routes “calls”, “goals” and “transactions” described above.

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/callsGoalsTransactions

Get all touch point triggers. This is a collection of recent land, call and goal triggers. You can only query back as far as your Installation’s trigger retention period on this route.

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/touchPoints

Get all visits triggers (where trigger act are lands)

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/visits

URL Path Params

GET Params

Filter Types

The triggers list may be filtered by any of the returned fields, except customs fields (pass-through with pt_ prefix and variables with c_ prefix).

Sort Types

Same fields as Filter Types, see above.

Response:

Returns a list of triggers that match the supplied filters. The response could be received in different formats based on the format parameter in the request. Available formats: json, xml or csv (by default).

Examples

Retrieve all triggers

Request

https://api.infinitycloud.com/reports/v2/igrps/1/triggers/all?startDate=2018-01-01&endDate=2018-07-01&limit=2

Response

{"rowId":"1","triggerDatetime":"2018-01-16 13:20:11","igrp":"1","dgrp":"0","ch":"1","src":"direct","act":"land","algo":"","attr":"","vref":"","href":"","num":"","term":"","vid":"93393a8e","t":"","goal":"0","srcHash":"abe88d1f435bafca9d8ba335c9bff04d","new":"2","pageTitle":"TTS number allocation test site UK's","pub":"","segment":"4","segmentGroupId":"0","dom":"","ref":"","network":"","matchRef":"","matchType":"","campaign":"","adGroup":"","adRef":"","keywordRef":"","dialledPhoneNumber":"02035555610","srcPhoneNumber":"0123456","destPhoneNumber":"test.user@localhost.net","callDuration":"0","bridgeDuration":"0","ringTime":"0","ivrDuration":"4","queueDuration":"2","operatorRef":"shahrukh.omar","ivrRef":"","dialplanRef":"","callRating":"","callState":"","callDirection":"in","callStage":"","operatorRealm":"","telcoCode":"ict","numType":"37","rec":"0","transcriptionConfidence":"0","totalKeywordScore":"0","totalOperatorKeywordScore":"26","totalContactKeywordScore":"-176","operatorPositiveKeywordCount":"0","operatorNeutralKeywordCount":"0","operatorNegativeKeywordCount":"0","contactPositiveKeywordCount":"0","contactNeutralKeywordCount":"0","contactNegativeKeywordCount":"0","callPciDataChecked":"0","callPciDataFound":"0","callSsnDataChecked":"0","callSsnDataFound":"0","callPiiDataChecked":"0","callPiiDataFound":"0","callKeywordSpotting":"0","callTranscription":"0","whois":"WHOIS PII Data","ip":"127.0.0.1","ua":"Mozilla 5.0","country":"","city":"","continent":"","res":"2560x1440","lat":"0.0000","long":"0.0000","region":"","postcode":"","area":"","spider":"","host":"","visitorType":"S","sfWhoRef":"","visitorPageCount":"1","visitorGoalCount":"0","visitorCallCount":"3","visitorFirstDatetime":"2018-01-16 13:20:11","landingPageId": "0","conversionPageId": "0","chName":"Direct","chType":"direct","segmentName":"test2","segmentRef":"test2","orgId":"1","segmentGroupName":"Default","notes":"[{"note": "Test Note 1", "createDatetime": "2023-01-01 09:00:00"}, {"note": "Test Note 2", "createDatetime": "2023-01-02 10:30:00"}]", "leadScore":"100"}
{"rowId":"2","triggerDatetime":"2018-01-24 11:34:14","igrp":"1","dgrp":"10008","ch":"0","src":"","act":"callBlegStart","algo":"failsafe","attr":"","vref":"","href":"","num":"02035555610","term":"","vid":"","t":"","goal":"0","srcHash":"","new":"0","pageTitle":"","pub":"","segment":"4","segmentGroupId":"0","txr":"2401","txv":"0.00","txc":"","goalValue":"0.00","goalCurrency":"","outcomeType":"C","dialledPhoneNumber":"02035555610","srcPhoneNumber":"test.user2","destPhoneNumber":"test.user@localhost.net","callDuration":"0","bridgeDuration":"0","ringTime":"0","ivrDuration":"4","queueDuration":"2","operatorRef":"test.user","ivrRef":"","dialplanRef":"","callRating":"","callState":"","callDirection":"in","callStage":"","operatorRealm":"","telcoCode":"ict","numType":"37","rec":"0","transcriptionConfidence":"0","totalKeywordScore":"0","totalOperatorKeywordScore":"26","totalContactKeywordScore":"-176","operatorPositiveKeywordCount":"0","operatorNeutralKeywordCount":"0","operatorNegativeKeywordCount":"0","contactPositiveKeywordCount":"0","contactNeutralKeywordCount":"0","contactNegativeKeywordCount":"0","callPciDataChecked":"0","callPciDataFound":"0","callSsnDataChecked":"0","callSsnDataFound":"0","callPiiDataChecked":"0","callPiiDataFound":"0","callKeywordSpotting":"0","callTranscription":"0","chName":"Unknown","chType":"offline","dgrpName":"Test DGR P SO  ","dgrpRef":"","callRatingId":"1","segmentName":"test2","segmentRef":"test2","orgId":"1","segmentGroupName":"Default","lands":0,"notes":"[{"note": "Test Note 1", "createDatetime": "2023-01-01 09:00:00"}, {"note": "Test Note 2", "createDatetime": "2023-01-02 10:30:00"}]", "leadScore":"300"}

Retrieve all triggers with filter

For performance reasons, results from the Infinity API are restricted to a maximum of number of rows per request. This maximum number is typically 10,000 and if you specify a higher limit value the API will return an error.

If you want a larger number of triggers then you must make multiple requests, fetching a small batch of triggers in each request. The most efficient way to do this is to sort and filter by rowId.

Start by requesting the first batch ( rowId > 0 ), record the last rowId seen in the response, and then use that to filter the next batch. Continue in this way until no rows are returned from the API.

Request the first batch:

https://api.infinitycloud.com/reports/v2/igrps/1/triggers/all?startDate=2015-05-01&endDate=2015-05-31&tz=Europe%2FLondon&limit=1000&filter[]=rowId-gt-value-0

In this request we have defined the IGRP, the date range and timezone. We have sorted the results by rowId ascending (required) and asked for no more than 1000 results (your batch size could be different but we’ve found 1000 to work well). We also requested only rowId values greater than zero. While this doesn’t actually filter the first batch (rowId is always positive), it highlights the difference in subsequent batch requests.

Check the results, noting the last rowId:

{"rowId":"141247288","triggerDatetime":"2015-05-01 00:00:01",...}
{"rowId":"141247289","triggerDatetime":"2015-05-01 00:00:02",...}
...
{"rowId":"141248744","triggerDatetime":"2015-05-01 00:19:45",...}
{"rowId":"141248745","triggerDatetime":"2015-05-01 00:19:57",...}

Note that the rowId may not start at 1 (some triggers are deleted after a certain time), there may be gaps in the rowId sequence, and that the triggerDatetime may be out of sequence with the rowId, due to the asynchronous nature of our tracking platform. The rowId will always be unique and incremental though, which is why this method works.

Use the last rowId to request the next batch (the only difference between this request and the previous request is the filtered rowId value at the end):

https://api.infinitycloud.com/reports/v2/igrps/1/triggers/all?startDate=2015-05-01&endDate=2015-05-31&tz=Europe%2FLondon&limit=1000&filter[]=rowId-gt-value-141248745

Continue in this way, changing the rowId in each request until you have worked through the whole result set and retrieve no more rows.

It is possible to retrieve all triggers from Infinity over time, e.g. to populate your own data warehouse with Infinity trigger data. To do this you can remove the date range (startDate and endDate parameters). Poll the API periodically to get new data, persisting the last seen rowId between requests so you don’t start from the beginning each time.

This method also works with other routes, e.g. to import all calls (/reports/v2/igrps/{IGRP SPECIFIER}/triggers/calls), or all transactions (/reports/v2/igrps/{IGRP SPECIFIER}/triggers/transactions).

Call Recording Export

Exports a call recording for a given rowId

Request:

GET /reports/v2/igrps/{IGRP SPECIFIER}/callRecording/{rowId}

URL Path Params

Response:

The call recording

Visitor Trace Triggers

Exports visitor trace triggers without real-time triggers or attribution data. This request filterable and sortable as usual.

Request:

GET /reports/v2/igrps/{IGRP SPECIFIER}/visitors/{VISITOR SPECIFIER}/triggers

URL Path Params

GET Params

Response:

A list of visitor trace triggers

Field Definitions

Here are definition for fields that can be returned in the Trigger reports.

General Fields

Marketing Sources

Goals and Transactions

Calls

Visitors

Custom Pass-Through Fields

Triggers can have certain landing tags persisted through a Visitor’s session and stored with every subsequent trigger.

For customers with pass-through tags enabled the following variables will be available.

Custom Fields

You can record non-session persisted variables against a trigger, these are called Custom Variables.

For customers using custom variables the following variables will be available.

Hangup States

A hangup state is what caused the call to be ended. It is in the format of {REASON}_{LEG}

E.g.

NORMAL_CLEARING_A - This means that the A-leg (caller) triggered the end of the call normally.

The following reasons are defined:

Itemised calls

Lists itemised calls for a specific IGRP.

Request:

GET /reports/v2/igrps/{IGRP SPECIFIER}/triggers/itemisedCalls

Params

GET Params

Filter Types

Sort Types

Same as Filter Types

Response:

Returns the HTTP response 200.

{"rowId":"4","callDuration":"8","srcPhoneNumber":"test.user2","dialledPhoneNumber":"012312345610","destPhoneNumber":"test.user2@localhost.net","callDirection":"in","callCharge":"0.020000","chargeCurrencyCode":"","perMinuteCharge":"0.020000","triggerDatetime":"2018-01-24 11:34:08","igrp":"1","dgrp":"10008","ch":"0","segment":"4","segmentGroupId":"0","chName":"Unknown","chType":"offline","dgrpName":"Test DGR P SO  ","dgrpRef":"","callRatingId":"1","segmentName":"test2","segmentRef":"test2","orgId":"1","segmentGroupName":"Default"}
{"rowId":"7","callDuration":"12","srcPhoneNumber":"test.user2","dialledPhoneNumber":"012312345610","destPhoneNumber":"test.user2@localhost.net","callDirection":"in","callCharge":"0.000000","chargeCurrencyCode":"","perMinuteCharge":"0.000000","triggerDatetime":"2018-01-26 12:07:55","igrp":"1","dgrp":"10008","ch":"0","segment":"4","segmentGroupId":"0","chName":"Unknown","chType":"offline","dgrpName":"DGRP","dgrpRef":"","callRatingId":"1","segmentName":"test2","segmentRef":"test2","orgId":"1","segmentGroupName":"Default"}