Knowledge base

How to send data to Matterbeam's HTTP collector

2 min read
How to send data to Matterbeam's HTTP collector

Did you know you can send data to Matterbeam over HTTP using our HTTP Collector?

Matterbeam provides an always available HTTP endpoint where you can PUT data for immediate use. Simply provide the name of your dataset in the url and a record in the request body.

You can get a curl command-line example from the Matterbeam UI, including the headers needed to authenticate your request, that will send JSON-formatted data to a specific API endpoint.

You can send a single record or multiple records in your curl request.

Single Record

From the Matterbeam UI, click on the "HTTP Collector" component, type in a "Dataset Name", then copy the code using the copy icon.

The auto generated code will automatically insert your environment and the dataset name you typed into the URL, your Authorization Token from your user profile, and some dummy data. Below we'll use a really simple record as an example:

curl --request PUT \
  --url https://CUSTOMER-api.matterbeam.com/datasets/test-http-collected-dataset/record \
  --header 'Authorization: Token XXXXXXXXXXXXXXXXXX' \
  --header 'Content-Type: application/json' \
  --data '{"flower": "rose","color": "red"}'

Here is how the dataset will appear in Matterbeam:

Multi-Record

To send a multi-record array to the HTTP Collector, we can just change the endpoint from "record" to "records", and send an array instead of a single record. In our example below we'll also use a new dataset name:

curl --request PUT \
 --url https://CUSTOMER-api.matterbeam.com/datasets/test-http-collected-dataset2/records \
 --header 'Authorization: Token XXXXXXXXXXXXXXXXXX' \
 --header 'Content-Type: application/json' \
 --data '[{"flower": "rose","color": "red"},{"flower": "violet","color": "blue"}]'

Here is how the dataset will appear in Matterbeam:

We hope this guide makes it easier for you to use our HTTP Collector to collect and manage your data. Whether you're sending single records or multiple entries at once, our Data Agility Platform is designed to streamline your data collection and integration processes seamlessly.

Share This Post

Check out these related posts

Writing Transforms in Python - Part 5

Writing Transforms in Python - Part 4

Writing Transforms in Python - Part 3