Realtime Data Export API

Through the Realtime Data Export API, it is possible to get your own data stream in Realtime, outputted to either Google's PubSub and BigQuery, Amazon's Kinesis or over HTTPS. There is a maximum of 3 outputs set as default.

Contents on this page

GET /realtime-data-export

Provides a list of all realtime data exports associated with the authenticated user's account.

Method

GET

Path

/api/realtime-data-export

Parameters

NameTypeRequiredDescription
idnumberNID of an existing realtime data export to retrieve

Example cURL

curl -X GET \
'https://platform.flxone.com/api/realtime-data-export?id=5' \
-H 'Cache-Control: no-cache' \
-H 'X-Auth: es5a88dmlpktb5t6k9eifm6Pqjd0l70otkm1p2dv6g13h3h2thkptomb3k8dqe3ms3Xvorgr72h99uec0n92mf9hki9d23aprtsmds3' \
-H 'X-CSRF: 14f61670139eb434adf7f148bbea1a30'

Output

{
    "response": {
        "status": "OK",
        "realtime_data_export": {
            "id": "5",
            "customer": "11",
            "user": "29",
            "title": "Export pixel 20310",
            "settings": {
                "rules": [
                    {
                        "id": "pixel_id",
                        "comparator": "equals",
                        "value": "20310",
                        "type": "dimension"
                    }
                ],
                "outputs": [
                    {
                        "type": "bigquery",
                        "settings": {
                            "projectId": "123456",
                            "datasetName": "DMP-Realtime",
                            "tablePrefix": "DMP-RT",
                            "jsonKey": "M79zxxas122uy5PE9JR82SGKGvKGuYnHuOy+DP/NtznzKgy3t763Z0ClgmAtKpyqKnS2myTs5Z8XQljC7mWr/8oISKbofqO4wIjezzfQi9c3jnMNxecjFlNq0APYCP5RRPdmn7ObuBWVOyl0v21R5impQjAlxpovjZLFbWfQM9a3lWOZklotp6EuuVCFbVf/Hqra4xI7wd5VUUbltmQ09sQVX2KAe7tOngBF1YX7Hn4GkE1tKY3kQbOaMoHx7bTc52Jba1aNvYtzNArAd15I72JjrXsaSfFnUdzMKnOtUHbX9SJrHl+JlyTX5ikTkyNTAUwZSV3gp/9aUdV9JPALkZLLHXKh4LOKymqgBHI3s8E8rOnAa+RSzIcYQ8M311hXZfqVP87d1dh0Ye10VeCut9rThLwV+rXsKfSd67KgSe1Et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0tdEXsajdXv8EEp+SQy0ILC3RP8gbHoYYh/uqBoIoX9gih0rXu0KK8JWoYL9kiVgfIifoivnyHdLBDdkUtwrnCCV9/aMVN7HLr7z47vUn6z0aoaWZJ/2JZC/FhiCfmqIXvI+MhnVlTwN12i8gUqDsfdduWTQUBNOL11/Oa0ErqzdForzepY19RhFLzdJhLqnlUbbyN4vjWbjTD0mjoz6DAykEOGdGKvOCIJH3SAXOhh4M8X6kaOCeljuMEEnzMxIb2EeLSVl/UCEvuSf6L4SFbCFqqmZt00haaaIDfu9zd3op/edw1zywhIbL7yI0kqhDUvMpahs0/2qAuHqjYBagJeD/aJxPjr3yCMkjJ2y7boeyAdxd1D2EsIdtcRXC8gCjKnSL3iELasd3dp/tiWZ2Or49FR12Y+7xUxez=="
                        }
                    }
                ],
                "fields": []
            },
            "deleted": "0",
            "modified": "2017-07-19 07:33:36",
            "created": "2017-07-19 07:33:36"
        }
    }
}

GET /realtime-data-export?id=[id]

Provides information about a specific realtime data export.

DELETE /realtime-data-export?id=[id]

Deletes a specific realtime data export.

POST /realtime-data-export

Description

Create a Realtime Data Export stream

Endpoint

/realtime-data-export

Method

POST 

Parameters

NameTypeRequiredDescription
titlestringY 
settingsstringYJSON string. Possible options for this are explained below. This must be url encoded.

Settings

NameTypeRequiredDescription
outputsarrayYSee details below
rulesarrayYSee details below
fieldsarrayYFor a possible option, check the Column Names in this link: Log Format

Outputs

The output is where the data will be exported to. The possible options per output can be found below.

NameTypeRequiredDescription
typestringY

The type of output. Can be either:

  • https
  • kinesis
  • pubsub
  • bigquery
settingsstringYJSON representation of this output's settings. The content of this JSON can be found below.

Output Settings

Each output has different settings. These can be found below

Kinesis

NameTypeRequiredDescription
accessKeystringYThe AWS Access Key
accessSecretstringY

The AWS Secret

regionstringYThe AWS region
streamNamestringYTo which Kinesis stream the data should be sent.

PubSub

NameTypeRequiredDescription
projectIdstringY 
topicIdstringYThe PubSub topic
jsonKeystringYGoogle JSON key (string) that has permissions to produce to PubSub

HTTPS

NameTypeRequiredDescription
endpointstringYTo which endpoint the data should be outputted.
secretstringYThe secret of this endpoint.

BigQuery

NameTypeRequiredDescription
projectIdstringY 
datasetNamestringY 
tablePrefixstringY 
jsonKeystringYGoogle JSON key (string) that has permissions to produce to BigQuery, create datasets, etc.

 

Please refer to the section authentication for the auth and csrf tokens.

Rules

NameTypeRequiredDescription
idstring 

Can be either:

  • pixel_id
  • geo_country
  • event_type
  • interaction_type
comparatorstring 

Can be either:

  • equals
  • =
  • notequals
  • !=
  • contains
  • doesnotcontains
  • after
  • >
  • half
  • end
  • >=
  • before
  • <
  • <=
  • between
valuestring Comma separated list of acceptable values
typestring 

Can be either:

  • dimension
  • measure

PubSub

NameTypeRequiredDescription
projectIdstringY 
topicIdstringYThe PubSub topic
jsonKeystringY 

HTTPS

NameTypeRequiredDescription
endpointstringYTo which endpoint the data should be outputted.
secretstringYThe secret of this endpoint.

BigQuery

NameTypeRequiredDescription
projectIdstringY 
datasetNamestringY 
tablePrefixstringY 
jsonKeystringY 

Example JSON

{
	"outputs": {
		"type": "bigquery",
		"settings": {
			"projectid": "test-1234",
			"datasetName": "test",
			"tablePrefix": "test",
			"jsonKey": "{\"a\":\"b\"}"
		}
	},
	"rules": [{
		"id": "pixel_id",
		"type": "dimension",
		"comparator": "=",
		"value": "12345"
	}],
	"fields": ["pixel_id", "uuid"]
}

 

Please refer to the section authentication for the auth and csrf tokens.