Skip to content

Latest commit

 

History

History
120 lines (96 loc) · 4.16 KB

File metadata and controls

120 lines (96 loc) · 4.16 KB
title description meta_tags namespace permalink menu_namespace
How to set a payload on Data Stream
Customize a payload while using a Standard HTTP/HTTPS POST connector.
Data Stream, how to, use, stream, event, logs, observe, observability
docs_data_streaming_payload
/documentation/products/guides/observe/data-stream-set-payload/
observeMenu

import Button from '/components/Button.astro' import Tabs from '/components/tabs/Tabs' import JourneyAPI from '~/includes/snippets/JourneyAPI/en/snippet.mdx'

:::caution[important] Azion has two user interfaces: Real-Time Manager and Console, which is in Preview stage. Currently, Console is only available for Developer plans and new accounts. Follow the steps according to the user interface you're using. :::

While configuring a stream with a Standard HTTP/HTTPS POST connector, you can set a payload to customize the data and how it'll be streamed.

In this guide, you'll learn how to configure a payload in NDJSON format.

Console Real-Time Manager API
  1. Access Azion Console > Data Stream.
  2. Follow the steps described on the How to use Standard HTTP/HTTPS POST to receive data guide for the Destination section.
  3. Under Payload, set the values you want to use:
    • Payload Format: use $dataset to use the variables added on the Data Set code box.
    • Payload Log Line Separator: use \n to separate lines.
    • Payload Max Size (optional): accepts values starting from 1000000.
  4. Click the Save button.
  1. Access Real-Time Manager > Data Stream.

  2. Follow the steps described on the How to use Standard HTTP/HTTPS POST to receive data guide for the Destination section.

  3. Under Payload, set the values you want to use:

    • Max Size (optional): accepts values starting from 1000000.
    • Log Line Separator (optional): use \n to separate lines.
    • Payload Format (optional): use $dataset to use the variables added on the Data Set code box.
  4. Click the Save button.

Via API

  1. Run the following POST request in your terminal, replacing [TOKEN VALUE] with your personal token:
curl --location 'https://api.azionapi.net/data_streaming/streamings' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
    "name": "My HTTPS connector",
    "template_id": 2,
    "domain_ids": [1656613172],
    "endpoint": {
        "endpoint_type": "standard",
        "url": "http://myhost.com",
        "payload_format": "$dataset",
        "log_line_separator": "\n",
        "max_size": 1000024,
        "headers":{
            "header-name-1": "header-api-value-1",
            "header-name-2": "header-api-value-2",
        }
    }
}'
  1. You'll receive a response similar to this:
{
  "results": {
    "id": 1595,
    "name": "My HTTPS connector",
    "template_id": 2,
    "data_source": "http",
    "active": true,
    "endpoint": {
      "endpoint_type": "standard",
      "url": "http://myhost.com",
      "log_line_separator": "\n",
      "payload_format": "$dataset",
      "max_size": 1000024,
      "headers": {
            "header-name-1": "header-api-value-1",
            "header-name-2": "header-api-value-2",
      }
    },
    "all_domains": false
  },
  "schema_version": 3
}

Wait a few minutes for the changes to propagate and your stream will be updated.



---

import ContributorList from '~/components/ContributorList.astro'

Contributors Contributor