Config API Version 2 Visitor Types
Introduction
Visitor Types provides the ability to match visitors against a set of criteria and prevent their data from contributing to the metrics.
There are two types of visitors that this feature applies to. The first is one that has a visitor ID assigned to it. This can be used to mark visitors as ‘I’ for internal’ or ‘S’ for spider. Visitors flagged in this way will show up as void within the Infinity Portal, and will not contribute to metrics.
If the visitor does not have a visitor ID assigned (e.g. someone calling a fixed number), then rather than using the visitorType field, the outcomeType field would be applied to the event. This can be used to mark the visit as ‘V’ for void.
Visitor Type Properties
- igrp (int) - Installation ID.
- visitorTypeRuleId (int) - An integer with the Visitor Type rule ID.
- visitorType (char) - Type of visitor.
- outcomeType (char) - Type of outcome.
- criteria (array) - An array of Rules for matching visitors.
- visitorDescription (string) - Description for the visitor rule.
List Visitor Types
Returns a list of Visitor Types for an Installation.
Request:
GET /config/v2/igrps/{IGRP SPECIFIER}/visitorTypes
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
GET Params
- filter (array) OPTIONAL - One or more filters.
- sort (array) OPTIONAL - One or more sorting params.
- limit (integer) OPTIONAL - Limit on the result set.
- offset (integer) OPTIONAL - Offset of the result set.
Filter Types
The Visitor Types list may be filtered by any of the returned fields
Sort Types
The Visitor list may be sorted by any of the returned fields
Response:
Returns a list of all Visitor Types for a given IGRP.
- visitorTypeRuleId (string) - Visitor Type Rule ID.
- visitorType (char) - Type of visitor.
- outcomeType (char) - Type of outcome.
- criteria (array) - An array of rules for matching visitors.
- visitorDescription (string) - Description for the visitor rule.
Response example:
{"visitorTypeRuleId":"1","visitorType":"I","outcomeType":"","criteria":[{"field":"ip","op":"eq","value":"192.168.0.1"}]}
{"visitorTypeRuleId":"2","visitorType":"S","outcomeType":"","criteria":[{"field":"whois","op":"inci","value":"google"}]}
{"visitorTypeRuleId":"3","visitorType":"","outcomeType":"V","criteria":[{"field":"srcPhoneNumber","op":"begins","value":"015101234567"}]}
Read Visitor Type
Read Visitor Type details for the specified Visitor Type Spec and IGRP.
Request:
GET /config/v2/igrps/{IGRP SPECIFIER}/visitorTypes/{VISITOR TYPE SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
- VISITOR TYPE SPECIFIER (int) - Visitor Type Rule ID.
Response:
Returns the Visitor Type requested.
- visitorTypeRuleId (string) - Visitor Type Rule ID.
- visitorType (char) - Friendly description of the Visitor Type.
- outcomeType (char) - Outcome type.
- criteria (array) - An array of rules for matching visitors.
- visitorDescription (string) - Description for the visitor rule.
Response example:
{"visitorTypeRuleId":"1","visitorType":"I","outcomeType":"","criteria":[{"field":"ip","op":"eq","value":"192.168.0.1"}]}
Create Visitor Type
This creates a new Visitor Type.
Request:
POST /config/v2/igrps/{IGRP SPECIFIER}/visitorTypes
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
POST Params
- criteria (array) - An array of rules for matching visitors.
- visitorDescription (string) - Description for the visitor rule.
- visitorType (char) OPTIONAL - ‘I’ for internal’, ‘S’ for spider or empty.
- outcomeType (char) OPTIONAL - ‘V’ for void or empty.
Response:
{"visitorTypeRuleId":"36","visitorType":"S","outcomeType":"","visitorDescription":"","criteria":[{"field":"field1","op":"eq","value":"1"},{"field":"field2","op":"eq","value":"2"}]}
Update Visitor Types
Updates the configuration of an existing Visitor Type.
Request:
POST /config/v2/igrps/{IGRP SPECIFIER}/visitorTypes/{VISITOR TYPE SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
- VISITOR TYPE SPECIFIER (int) - Visitor Type Rule ID.
POST Params
- criteria (array) - An array of rules for matching visitors.
- visitorType (char) OPTIONAL - ‘I’ for internal’, ‘S’ for spider or empty.
- outcomeType (char) OPTIONAL - ‘V’ for void or empty.
- visitorDescription (string) OPTIONAL - Description for the visitor rule.
Response:
Returns the HTTP 204 (No Content) status code if update successful.
HTTP 204 - NO CONTENT
Delete Visitor Types
Deletes an existing Visitor Type.
Request:
DELETE /config/v2/igrps/{IGRP SPECIFIER}/visitorTypes/{VISITOR TYPE SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
- VISITOR TYPE SPECIFIER (int) - Visitor Type Rule ID.
Response:
Returns the HTTP 204 (No Content) status code if update successful.
HTTP 204 - NO CONTENT