Data Collection API

The data collection API (DCAPI) allows you to send data to Oracle Infinity from applications or sites that do not have JavaScript enabled.

Note: For more details about this implementation, contact your Oracle Infinity solutions consultant.

The DCAPI is a REST API that uses a POST request to send a JSON message body containing key value pairs over HTTP/S. This provides an alternative to using the Oracle Infinity Tag and allows you to send multiple event bodies in a nested JSON block using GZIP compression. For example, the Oracle Infinity mobile SDKs use DCAPI to batch multiple events into a single compressed payload to reduce transmission time and bandwidth.

You can use the DCAPI to collect data from:

  • Internet of things (IoT) devices with embedded computers and WebSocket outputs
  • Server-side data collection for web-enabled applications
  • Set-top boxes (STBs)
  • Test benches in an automated QA lab, such as bench status, test results, runtime, and so on

Constructing a JSON payload

To send data to Oracle Infinity using the DCAPI, your JSON payload must meet the following requirements:

  • It must be a valid JSON object. Use JSON validators to check that your payloads are correctly formatted and delimited.
  • It can have an optional "static" field. While not required, it is useful to put common key value pairs in the static block.
  • If a "static" field is present, it must have at least one valid key value pair. An empty static block is not allowed.
  • Each JSON payload must contain an "events" field, which must contain at least one valid event block with at least one valid key value pair. Alternately, it may contain a list of valid events, each of which contains at least one properly JSON formatted key value pair. Empty events and empty or missing event blocks are not allowed.
  • Each event must have a time stamp.
  • Send all key : value pairs as string values. E.g. "key" : "value"

The following parameters are required to successfully collect an event:

  • dcssip: The domain visited, such as www.example.com (if sent from a website)
  • dcsuri: The URI stem, which is the portion of a URL that appears after the host and port and precedes the query string. It is typically the requested file or page that a user accessed.
  • wt.dcsvid identifies an optional unique custom visitor ID you can assign to your visitors in other systems. This is separate and distinct from automatically generated visitor ID parameters sent by the Oracle Infinity Tag. If you do not send a custom value, this parameter will not be present on the hit.
  • wt.ets indicates the Unix time stamp for the event measured in milliseconds.
  • wt.dl specifies a numeric identifier for the kind of event tracked, which are used for event-level filtering and reporting.
  • wt.co_f is a random value used as a visitor ID and stored in a first-party cookie.

You can also send a variety of optional parameters for each event.

The following example JSON payload shows a simplified format with two events that share the same visitor ID (wt.co_f): a simulated page view and a subscription click.

Some of its sample values are for required parameters and a few optional parameters were also included. For descriptions of the possible parameters that can be passed to data collection see the parameter reference.

Example JSON payload from a mobile SDK event:

Example JavaScript request

The following JavaScript sample for sending events in a simple JSON datga structure to the Oracle Infinity data collection servers does not use GZIP compression:

Example request using Java

This is an example implemented in Java for sending events in a simple JSON data structure to the Oracle Infinity data collection server. The Apache HttpComponents library is used to send the HTTP request. The Oracle Infinity data collection also provides an ability to get gzip-compressed data. If you want to send compressed JSON, the Apache HttpComponents library is one of many that can be used for that purpose.

Example request using Kotlin

This is an example implemented in Kotlin for sending events in a simple JSON data structure to the Oracle Infinity data collection server. The Apache HttpComponents library is used to send the HTTP request. The Oracle Infinity data collection also provides an ability to get gzip-compressed data. If you want to send compressed JSON, the Apache HttpComponents library is one of many that can be used for that purpose.

Example request using Python

This is an example implemented in Python for sending events in a simple JSON data structure to the Oracle Infinity data collection server. The requests and JSON libraries are used to send HTTP requests. The Oracle Infinity data collection also provides an ability to get gzip-compressed data. If you want to send compressed JSON, the zlib library is one of many that can be used for that purpose.

Example request using C/C++

This is an example implemented in C/C++ for sending events in a simple JSON data structure to the Oracle Infinity data collection server. The curl library is used to send the HTTP request. The Oracle Infinity data collection server also provides an ability to get gzip-compressed data. If you want to send compressed JSON, the zlib library is one of many that can be used for that purpose.

Example request using C#

This is an example implemented in C# for sending events in a simple JSON data structure to the Oracle Infinity data collection server. The System.Net.Http library is used to send the HTTP request. The Oracle Infinity data collection server also provides an ability to get gzip-compressed data. If you want to send compressed JSON, the System.IO.Compression.GZipStream library is one of many that can be used for that purpose.

Example request using PHP

This is an example implemented in PHP for sending events in a simple JSON data structure to the Oracle Infinity data collection server. The curl library is used to send the HTTP request. The Oracle Infinity data collection server also provides an ability to get gzip-compressed data. If you want to send compressed JSON, the gzencode library is one of many that can be used for that purpose.

Example request using Visual Basic .NET

This is an example implemented in Visual Basic .NET for sending events in a simple JSON data structure to the Oracle Infinity data collection server. The System.Net. library is used to send the HTTP request. The Oracle Infinity data collection server also provides an ability to get gzip-compressed data. If you want to send compressed JSON, the System.IO.Compression.GZipStream library is one of many that can be used for that purpose.

POSTing a JSON payload

Once you create a valid JSON payload, use your account GUID to POST it to the following DCAPI endpoint:

https://dc.oracleinfinity.io/v3/account_GUID

Legacy implementations must be migrated to v3. Oracle Infinity no longer supports v1 or v2. Account GUID replaces dcsid as an identifier.

Tip: To receive debug messages, append dcsverbose=true to the URL. The following sample response would indicate a successful POST:

Learn more

Parameter Syntax - Syntax for parameter names and values.

Full Parameter Reference - Full reference of all available parameters.

mobile SDK, Android, iOS