curl --request PUT \
--url https://api-dev.narrative.io/data-stream/{data_stream_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "f94e8803-fc03-4c3e-a3fc-c3ffe3993788",
"company_id": 100,
"name": "best data stream name",
"slug": "this-is-a-slug",
"content": {
"description": "Fabulous Data Stream even better than anything out there!",
"icon": "https://some.icon.png",
"sections": [
{
"title": "some title",
"description": "some description",
"image": "some-image"
},
{
"whatever": "whatever json structure FE would like to have here.",
"free_form": "json here"
}
]
},
"tags": [
"tag1",
"tag2"
],
"category": "categoryA",
"offers": [
{
"id": "16310512-a8fb-4ce8-aec3-573693067df9",
"channel": "data_streams_market",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 70000
},
"shops": null
},
{
"id": "d7542ec5-558f-4e98-9ff6-e049b24798fa",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 50000
},
"shops": null
},
{
"id": "5d52d8d8-b683-4ef4-9220-31347dc2237f",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "max_price_per_record",
"micro_cents_usd": 30000
},
"shops": [
"only.on.tld.com"
]
}
],
"data_rules": {
"column_sets": [
{
"dataset_id": 99999,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
},
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": true
}
],
"optional": true
},
{
"attribute_id": 321,
"fields": [
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": false
}
],
"optional": false
}
],
"deduplication": {
"period": "P60D",
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9",
"col9.foo.bar"
]
}
]
},
"frequency_filter": {
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9.foo.bar"
]
}
],
"min_inclusive": 2,
"max_inclusive": 5
}
},
"auth_rules": {
"company_constraint": {
"type": "inclusion",
"company_ids": [
160,
1701
]
}
},
"created_by": 5000,
"created_at": "2021-06-29T10:58:36.726Z",
"updated_at": "2021-06-29T10:58:36.726Z",
"datasets": null
}
'import requests
url = "https://api-dev.narrative.io/data-stream/{data_stream_id}"
payload = {
"id": "f94e8803-fc03-4c3e-a3fc-c3ffe3993788",
"company_id": 100,
"name": "best data stream name",
"slug": "this-is-a-slug",
"content": {
"description": "Fabulous Data Stream even better than anything out there!",
"icon": "https://some.icon.png",
"sections": [
{
"title": "some title",
"description": "some description",
"image": "some-image"
},
{
"whatever": "whatever json structure FE would like to have here.",
"free_form": "json here"
}
]
},
"tags": ["tag1", "tag2"],
"category": "categoryA",
"offers": [
{
"id": "16310512-a8fb-4ce8-aec3-573693067df9",
"channel": "data_streams_market",
"licensing": {
"period": "P90D",
"license": { "name": "narrative opendata license" }
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 70000
},
"shops": None
},
{
"id": "d7542ec5-558f-4e98-9ff6-e049b24798fa",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": { "name": "narrative opendata license" }
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 50000
},
"shops": None
},
{
"id": "5d52d8d8-b683-4ef4-9220-31347dc2237f",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": { "name": "narrative opendata license" }
},
"pricing": {
"type": "max_price_per_record",
"micro_cents_usd": 30000
},
"shops": ["only.on.tld.com"]
}
],
"data_rules": {
"column_sets": [
{
"dataset_id": 99999,
"fields": [
{
"field": "col1",
"filter": None,
"exported": True
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": True
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": True
},
{
"field": "col4",
"filter": {
"type": "include",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": None,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": False
},
{
"field": "col7",
"filter": {
"type": "include",
"list": ["true"]
},
"exported": True
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": None,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": True
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "col1",
"filter": None,
"exported": True
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": True
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": True
},
{
"field": "col4",
"filter": {
"type": "include",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": None,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": False
},
{
"field": "col7",
"filter": {
"type": "include",
"list": ["true"]
},
"exported": True
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": None,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": True
},
{
"field": "col9",
"filter": { "expressions": ["col9 > -90", "col9 < 90"] },
"exported": True
}
],
"optional": True
},
{
"attribute_id": 321,
"fields": [
{
"field": "col9",
"filter": { "expressions": ["col9 > -90", "col9 < 90"] },
"exported": False
}
],
"optional": False
}
],
"deduplication": {
"period": "P60D",
"column_references": None,
"attribute_references": [
{
"attribute_id": 123,
"column_names": ["col9", "col9.foo.bar"]
}
]
},
"frequency_filter": {
"column_references": None,
"attribute_references": [
{
"attribute_id": 123,
"column_names": ["col9.foo.bar"]
}
],
"min_inclusive": 2,
"max_inclusive": 5
}
},
"auth_rules": { "company_constraint": {
"type": "inclusion",
"company_ids": [160, 1701]
} },
"created_by": 5000,
"created_at": "2021-06-29T10:58:36.726Z",
"updated_at": "2021-06-29T10:58:36.726Z",
"datasets": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'f94e8803-fc03-4c3e-a3fc-c3ffe3993788',
company_id: 100,
name: 'best data stream name',
slug: 'this-is-a-slug',
content: {
description: 'Fabulous Data Stream even better than anything out there!',
icon: 'https://some.icon.png',
sections: [
{title: 'some title', description: 'some description', image: 'some-image'},
{
whatever: 'whatever json structure FE would like to have here.',
free_form: 'json here'
}
]
},
tags: ['tag1', 'tag2'],
category: 'categoryA',
offers: [
{
id: '16310512-a8fb-4ce8-aec3-573693067df9',
channel: 'data_streams_market',
licensing: {period: 'P90D', license: {name: 'narrative opendata license'}},
pricing: {type: 'per_record', micro_cents_usd: 70000},
shops: null
},
{
id: 'd7542ec5-558f-4e98-9ff6-e049b24798fa',
channel: 'data_shop',
licensing: {period: 'P90D', license: {name: 'narrative opendata license'}},
pricing: {type: 'per_record', micro_cents_usd: 50000},
shops: null
},
{
id: '5d52d8d8-b683-4ef4-9220-31347dc2237f',
channel: 'data_shop',
licensing: {period: 'P90D', license: {name: 'narrative opendata license'}},
pricing: {type: 'max_price_per_record', micro_cents_usd: 30000},
shops: ['only.on.tld.com']
}
],
data_rules: {
column_sets: [
{
dataset_id: 99999,
fields: [
{field: 'col1', filter: null, exported: true},
{
field: 'col2',
filter: 'include_all_values_including_nulls_filter',
exported: true
},
{field: 'col3', filter: 'include_only_if_not_null_filter', exported: true},
{
field: 'col4',
filter: {type: 'include', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col5',
filter: {type: 'exclude', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col6',
filter: {
min: {type: 'inclusive', value: '-100'},
max: {type: 'inclusive', value: '100'}
},
exported: true
},
{
field: 'col6',
filter: {min: null, max: {type: 'exclusive', value: 'timestamp01'}},
exported: false
},
{field: 'col7', filter: {type: 'include', list: ['true']}, exported: true},
{
field: 'col8',
filter: {recency: 'P30D', from: null, to: {type: 'exclusive', value: 'timestamp01'}},
exported: true
}
]
}
],
attributes: [
{
attribute_id: 123,
fields: [
{field: 'col1', filter: null, exported: true},
{
field: 'col2',
filter: 'include_all_values_including_nulls_filter',
exported: true
},
{field: 'col3', filter: 'include_only_if_not_null_filter', exported: true},
{
field: 'col4',
filter: {type: 'include', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col5',
filter: {type: 'exclude', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col6',
filter: {
min: {type: 'inclusive', value: '-100'},
max: {type: 'inclusive', value: '100'}
},
exported: true
},
{
field: 'col6',
filter: {min: null, max: {type: 'exclusive', value: 'timestamp01'}},
exported: false
},
{field: 'col7', filter: {type: 'include', list: ['true']}, exported: true},
{
field: 'col8',
filter: {recency: 'P30D', from: null, to: {type: 'exclusive', value: 'timestamp01'}},
exported: true
},
{
field: 'col9',
filter: {expressions: ['col9 > -90', 'col9 < 90']},
exported: true
}
],
optional: true
},
{
attribute_id: 321,
fields: [
{
field: 'col9',
filter: {expressions: ['col9 > -90', 'col9 < 90']},
exported: false
}
],
optional: false
}
],
deduplication: {
period: 'P60D',
column_references: null,
attribute_references: [{attribute_id: 123, column_names: ['col9', 'col9.foo.bar']}]
},
frequency_filter: {
column_references: null,
attribute_references: [{attribute_id: 123, column_names: ['col9.foo.bar']}],
min_inclusive: 2,
max_inclusive: 5
}
},
auth_rules: {company_constraint: {type: 'inclusion', company_ids: [160, 1701]}},
created_by: 5000,
created_at: '2021-06-29T10:58:36.726Z',
updated_at: '2021-06-29T10:58:36.726Z',
datasets: null
})
};
fetch('https://api-dev.narrative.io/data-stream/{data_stream_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/data-stream/{data_stream_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'f94e8803-fc03-4c3e-a3fc-c3ffe3993788',
'company_id' => 100,
'name' => 'best data stream name',
'slug' => 'this-is-a-slug',
'content' => [
'description' => 'Fabulous Data Stream even better than anything out there!',
'icon' => 'https://some.icon.png',
'sections' => [
[
'title' => 'some title',
'description' => 'some description',
'image' => 'some-image'
],
[
'whatever' => 'whatever json structure FE would like to have here.',
'free_form' => 'json here'
]
]
],
'tags' => [
'tag1',
'tag2'
],
'category' => 'categoryA',
'offers' => [
[
'id' => '16310512-a8fb-4ce8-aec3-573693067df9',
'channel' => 'data_streams_market',
'licensing' => [
'period' => 'P90D',
'license' => [
'name' => 'narrative opendata license'
]
],
'pricing' => [
'type' => 'per_record',
'micro_cents_usd' => 70000
],
'shops' => null
],
[
'id' => 'd7542ec5-558f-4e98-9ff6-e049b24798fa',
'channel' => 'data_shop',
'licensing' => [
'period' => 'P90D',
'license' => [
'name' => 'narrative opendata license'
]
],
'pricing' => [
'type' => 'per_record',
'micro_cents_usd' => 50000
],
'shops' => null
],
[
'id' => '5d52d8d8-b683-4ef4-9220-31347dc2237f',
'channel' => 'data_shop',
'licensing' => [
'period' => 'P90D',
'license' => [
'name' => 'narrative opendata license'
]
],
'pricing' => [
'type' => 'max_price_per_record',
'micro_cents_usd' => 30000
],
'shops' => [
'only.on.tld.com'
]
]
],
'data_rules' => [
'column_sets' => [
[
'dataset_id' => 99999,
'fields' => [
[
'field' => 'col1',
'filter' => null,
'exported' => true
],
[
'field' => 'col2',
'filter' => 'include_all_values_including_nulls_filter',
'exported' => true
],
[
'field' => 'col3',
'filter' => 'include_only_if_not_null_filter',
'exported' => true
],
[
'field' => 'col4',
'filter' => [
'type' => 'include',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col5',
'filter' => [
'type' => 'exclude',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => [
'type' => 'inclusive',
'value' => '-100'
],
'max' => [
'type' => 'inclusive',
'value' => '100'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => null,
'max' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => false
],
[
'field' => 'col7',
'filter' => [
'type' => 'include',
'list' => [
'true'
]
],
'exported' => true
],
[
'field' => 'col8',
'filter' => [
'recency' => 'P30D',
'from' => null,
'to' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => true
]
]
]
],
'attributes' => [
[
'attribute_id' => 123,
'fields' => [
[
'field' => 'col1',
'filter' => null,
'exported' => true
],
[
'field' => 'col2',
'filter' => 'include_all_values_including_nulls_filter',
'exported' => true
],
[
'field' => 'col3',
'filter' => 'include_only_if_not_null_filter',
'exported' => true
],
[
'field' => 'col4',
'filter' => [
'type' => 'include',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col5',
'filter' => [
'type' => 'exclude',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => [
'type' => 'inclusive',
'value' => '-100'
],
'max' => [
'type' => 'inclusive',
'value' => '100'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => null,
'max' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => false
],
[
'field' => 'col7',
'filter' => [
'type' => 'include',
'list' => [
'true'
]
],
'exported' => true
],
[
'field' => 'col8',
'filter' => [
'recency' => 'P30D',
'from' => null,
'to' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => true
],
[
'field' => 'col9',
'filter' => [
'expressions' => [
'col9 > -90',
'col9 < 90'
]
],
'exported' => true
]
],
'optional' => true
],
[
'attribute_id' => 321,
'fields' => [
[
'field' => 'col9',
'filter' => [
'expressions' => [
'col9 > -90',
'col9 < 90'
]
],
'exported' => false
]
],
'optional' => false
]
],
'deduplication' => [
'period' => 'P60D',
'column_references' => null,
'attribute_references' => [
[
'attribute_id' => 123,
'column_names' => [
'col9',
'col9.foo.bar'
]
]
]
],
'frequency_filter' => [
'column_references' => null,
'attribute_references' => [
[
'attribute_id' => 123,
'column_names' => [
'col9.foo.bar'
]
]
],
'min_inclusive' => 2,
'max_inclusive' => 5
]
],
'auth_rules' => [
'company_constraint' => [
'type' => 'inclusion',
'company_ids' => [
160,
1701
]
]
],
'created_by' => 5000,
'created_at' => '2021-06-29T10:58:36.726Z',
'updated_at' => '2021-06-29T10:58:36.726Z',
'datasets' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/data-stream/{data_stream_id}"
payload := strings.NewReader("{\n \"id\": \"f94e8803-fc03-4c3e-a3fc-c3ffe3993788\",\n \"company_id\": 100,\n \"name\": \"best data stream name\",\n \"slug\": \"this-is-a-slug\",\n \"content\": {\n \"description\": \"Fabulous Data Stream even better than anything out there!\",\n \"icon\": \"https://some.icon.png\",\n \"sections\": [\n {\n \"title\": \"some title\",\n \"description\": \"some description\",\n \"image\": \"some-image\"\n },\n {\n \"whatever\": \"whatever json structure FE would like to have here.\",\n \"free_form\": \"json here\"\n }\n ]\n },\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"category\": \"categoryA\",\n \"offers\": [\n {\n \"id\": \"16310512-a8fb-4ce8-aec3-573693067df9\",\n \"channel\": \"data_streams_market\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 70000\n },\n \"shops\": null\n },\n {\n \"id\": \"d7542ec5-558f-4e98-9ff6-e049b24798fa\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 50000\n },\n \"shops\": null\n },\n {\n \"id\": \"5d52d8d8-b683-4ef4-9220-31347dc2237f\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"max_price_per_record\",\n \"micro_cents_usd\": 30000\n },\n \"shops\": [\n \"only.on.tld.com\"\n ]\n }\n ],\n \"data_rules\": {\n \"column_sets\": [\n {\n \"dataset_id\": 99999,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"attribute_id\": 123,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": true\n }\n ],\n \"optional\": true\n },\n {\n \"attribute_id\": 321,\n \"fields\": [\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": false\n }\n ],\n \"optional\": false\n }\n ],\n \"deduplication\": {\n \"period\": \"P60D\",\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9\",\n \"col9.foo.bar\"\n ]\n }\n ]\n },\n \"frequency_filter\": {\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9.foo.bar\"\n ]\n }\n ],\n \"min_inclusive\": 2,\n \"max_inclusive\": 5\n }\n },\n \"auth_rules\": {\n \"company_constraint\": {\n \"type\": \"inclusion\",\n \"company_ids\": [\n 160,\n 1701\n ]\n }\n },\n \"created_by\": 5000,\n \"created_at\": \"2021-06-29T10:58:36.726Z\",\n \"updated_at\": \"2021-06-29T10:58:36.726Z\",\n \"datasets\": null\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-dev.narrative.io/data-stream/{data_stream_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"f94e8803-fc03-4c3e-a3fc-c3ffe3993788\",\n \"company_id\": 100,\n \"name\": \"best data stream name\",\n \"slug\": \"this-is-a-slug\",\n \"content\": {\n \"description\": \"Fabulous Data Stream even better than anything out there!\",\n \"icon\": \"https://some.icon.png\",\n \"sections\": [\n {\n \"title\": \"some title\",\n \"description\": \"some description\",\n \"image\": \"some-image\"\n },\n {\n \"whatever\": \"whatever json structure FE would like to have here.\",\n \"free_form\": \"json here\"\n }\n ]\n },\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"category\": \"categoryA\",\n \"offers\": [\n {\n \"id\": \"16310512-a8fb-4ce8-aec3-573693067df9\",\n \"channel\": \"data_streams_market\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 70000\n },\n \"shops\": null\n },\n {\n \"id\": \"d7542ec5-558f-4e98-9ff6-e049b24798fa\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 50000\n },\n \"shops\": null\n },\n {\n \"id\": \"5d52d8d8-b683-4ef4-9220-31347dc2237f\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"max_price_per_record\",\n \"micro_cents_usd\": 30000\n },\n \"shops\": [\n \"only.on.tld.com\"\n ]\n }\n ],\n \"data_rules\": {\n \"column_sets\": [\n {\n \"dataset_id\": 99999,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"attribute_id\": 123,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": true\n }\n ],\n \"optional\": true\n },\n {\n \"attribute_id\": 321,\n \"fields\": [\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": false\n }\n ],\n \"optional\": false\n }\n ],\n \"deduplication\": {\n \"period\": \"P60D\",\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9\",\n \"col9.foo.bar\"\n ]\n }\n ]\n },\n \"frequency_filter\": {\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9.foo.bar\"\n ]\n }\n ],\n \"min_inclusive\": 2,\n \"max_inclusive\": 5\n }\n },\n \"auth_rules\": {\n \"company_constraint\": {\n \"type\": \"inclusion\",\n \"company_ids\": [\n 160,\n 1701\n ]\n }\n },\n \"created_by\": 5000,\n \"created_at\": \"2021-06-29T10:58:36.726Z\",\n \"updated_at\": \"2021-06-29T10:58:36.726Z\",\n \"datasets\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/data-stream/{data_stream_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"f94e8803-fc03-4c3e-a3fc-c3ffe3993788\",\n \"company_id\": 100,\n \"name\": \"best data stream name\",\n \"slug\": \"this-is-a-slug\",\n \"content\": {\n \"description\": \"Fabulous Data Stream even better than anything out there!\",\n \"icon\": \"https://some.icon.png\",\n \"sections\": [\n {\n \"title\": \"some title\",\n \"description\": \"some description\",\n \"image\": \"some-image\"\n },\n {\n \"whatever\": \"whatever json structure FE would like to have here.\",\n \"free_form\": \"json here\"\n }\n ]\n },\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"category\": \"categoryA\",\n \"offers\": [\n {\n \"id\": \"16310512-a8fb-4ce8-aec3-573693067df9\",\n \"channel\": \"data_streams_market\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 70000\n },\n \"shops\": null\n },\n {\n \"id\": \"d7542ec5-558f-4e98-9ff6-e049b24798fa\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 50000\n },\n \"shops\": null\n },\n {\n \"id\": \"5d52d8d8-b683-4ef4-9220-31347dc2237f\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"max_price_per_record\",\n \"micro_cents_usd\": 30000\n },\n \"shops\": [\n \"only.on.tld.com\"\n ]\n }\n ],\n \"data_rules\": {\n \"column_sets\": [\n {\n \"dataset_id\": 99999,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"attribute_id\": 123,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": true\n }\n ],\n \"optional\": true\n },\n {\n \"attribute_id\": 321,\n \"fields\": [\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": false\n }\n ],\n \"optional\": false\n }\n ],\n \"deduplication\": {\n \"period\": \"P60D\",\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9\",\n \"col9.foo.bar\"\n ]\n }\n ]\n },\n \"frequency_filter\": {\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9.foo.bar\"\n ]\n }\n ],\n \"min_inclusive\": 2,\n \"max_inclusive\": 5\n }\n },\n \"auth_rules\": {\n \"company_constraint\": {\n \"type\": \"inclusion\",\n \"company_ids\": [\n 160,\n 1701\n ]\n }\n },\n \"created_by\": 5000,\n \"created_at\": \"2021-06-29T10:58:36.726Z\",\n \"updated_at\": \"2021-06-29T10:58:36.726Z\",\n \"datasets\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "f94e8803-fc03-4c3e-a3fc-c3ffe3993788",
"company_id": 100,
"name": "best data stream name",
"slug": "this-is-a-slug",
"content": {
"description": "Fabulous Data Stream even better than anything out there!",
"icon": "https://some.icon.png",
"sections": [
{
"title": "some title",
"description": "some description",
"image": "some-image"
},
{
"whatever": "whatever json structure FE would like to have here.",
"free_form": "json here"
}
]
},
"tags": [
"tag1",
"tag2"
],
"category": "categoryA",
"offers": [
{
"id": "16310512-a8fb-4ce8-aec3-573693067df9",
"channel": "data_streams_market",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 70000
},
"shops": null
},
{
"id": "d7542ec5-558f-4e98-9ff6-e049b24798fa",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 50000
},
"shops": null
},
{
"id": "5d52d8d8-b683-4ef4-9220-31347dc2237f",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "max_price_per_record",
"micro_cents_usd": 30000
},
"shops": [
"only.on.tld.com"
]
}
],
"data_rules": {
"column_sets": [
{
"dataset_id": 99999,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
},
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": true
}
],
"optional": true
},
{
"attribute_id": 321,
"fields": [
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": false
}
],
"optional": false
}
],
"deduplication": {
"period": "P60D",
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9",
"col9.foo.bar"
]
}
]
},
"frequency_filter": {
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9.foo.bar"
]
}
],
"min_inclusive": 2,
"max_inclusive": 5
}
},
"auth_rules": {
"company_constraint": {
"type": "inclusion",
"company_ids": [
160,
1701
]
}
},
"created_by": 5000,
"created_at": "2021-06-29T10:58:36.726Z",
"updated_at": "2021-06-29T10:58:36.726Z",
"datasets": null
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Update a data-stream.
Update a new data-stream.
The main idea: get a data-stream document/resource, after creation or accessing by id, then update the document and PUT it as it is.
Of course certain things aren’t updateable and are ignored, for instance identifiers already established (like DS id) and metadata like creation/update dates and who created/updated the entity.
Things that can be updated
- name
- slug
- content
- tags
- category
- offers
- data_rules
- auth_rules
Note: nested structures like content etc. are changed as complete structures, hence care needs to be taken to include unchanged data at as the same time as the data being changed so as not to over-write the rest of it.
Any validations applicable on creation time also apply on updates.
Only a user belonging to the company can update a data-stream.
curl --request PUT \
--url https://api-dev.narrative.io/data-stream/{data_stream_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "f94e8803-fc03-4c3e-a3fc-c3ffe3993788",
"company_id": 100,
"name": "best data stream name",
"slug": "this-is-a-slug",
"content": {
"description": "Fabulous Data Stream even better than anything out there!",
"icon": "https://some.icon.png",
"sections": [
{
"title": "some title",
"description": "some description",
"image": "some-image"
},
{
"whatever": "whatever json structure FE would like to have here.",
"free_form": "json here"
}
]
},
"tags": [
"tag1",
"tag2"
],
"category": "categoryA",
"offers": [
{
"id": "16310512-a8fb-4ce8-aec3-573693067df9",
"channel": "data_streams_market",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 70000
},
"shops": null
},
{
"id": "d7542ec5-558f-4e98-9ff6-e049b24798fa",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 50000
},
"shops": null
},
{
"id": "5d52d8d8-b683-4ef4-9220-31347dc2237f",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "max_price_per_record",
"micro_cents_usd": 30000
},
"shops": [
"only.on.tld.com"
]
}
],
"data_rules": {
"column_sets": [
{
"dataset_id": 99999,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
},
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": true
}
],
"optional": true
},
{
"attribute_id": 321,
"fields": [
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": false
}
],
"optional": false
}
],
"deduplication": {
"period": "P60D",
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9",
"col9.foo.bar"
]
}
]
},
"frequency_filter": {
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9.foo.bar"
]
}
],
"min_inclusive": 2,
"max_inclusive": 5
}
},
"auth_rules": {
"company_constraint": {
"type": "inclusion",
"company_ids": [
160,
1701
]
}
},
"created_by": 5000,
"created_at": "2021-06-29T10:58:36.726Z",
"updated_at": "2021-06-29T10:58:36.726Z",
"datasets": null
}
'import requests
url = "https://api-dev.narrative.io/data-stream/{data_stream_id}"
payload = {
"id": "f94e8803-fc03-4c3e-a3fc-c3ffe3993788",
"company_id": 100,
"name": "best data stream name",
"slug": "this-is-a-slug",
"content": {
"description": "Fabulous Data Stream even better than anything out there!",
"icon": "https://some.icon.png",
"sections": [
{
"title": "some title",
"description": "some description",
"image": "some-image"
},
{
"whatever": "whatever json structure FE would like to have here.",
"free_form": "json here"
}
]
},
"tags": ["tag1", "tag2"],
"category": "categoryA",
"offers": [
{
"id": "16310512-a8fb-4ce8-aec3-573693067df9",
"channel": "data_streams_market",
"licensing": {
"period": "P90D",
"license": { "name": "narrative opendata license" }
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 70000
},
"shops": None
},
{
"id": "d7542ec5-558f-4e98-9ff6-e049b24798fa",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": { "name": "narrative opendata license" }
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 50000
},
"shops": None
},
{
"id": "5d52d8d8-b683-4ef4-9220-31347dc2237f",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": { "name": "narrative opendata license" }
},
"pricing": {
"type": "max_price_per_record",
"micro_cents_usd": 30000
},
"shops": ["only.on.tld.com"]
}
],
"data_rules": {
"column_sets": [
{
"dataset_id": 99999,
"fields": [
{
"field": "col1",
"filter": None,
"exported": True
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": True
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": True
},
{
"field": "col4",
"filter": {
"type": "include",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": None,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": False
},
{
"field": "col7",
"filter": {
"type": "include",
"list": ["true"]
},
"exported": True
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": None,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": True
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "col1",
"filter": None,
"exported": True
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": True
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": True
},
{
"field": "col4",
"filter": {
"type": "include",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": ["this", "that", "that too", "some more"]
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": True
},
{
"field": "col6",
"filter": {
"min": None,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": False
},
{
"field": "col7",
"filter": {
"type": "include",
"list": ["true"]
},
"exported": True
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": None,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": True
},
{
"field": "col9",
"filter": { "expressions": ["col9 > -90", "col9 < 90"] },
"exported": True
}
],
"optional": True
},
{
"attribute_id": 321,
"fields": [
{
"field": "col9",
"filter": { "expressions": ["col9 > -90", "col9 < 90"] },
"exported": False
}
],
"optional": False
}
],
"deduplication": {
"period": "P60D",
"column_references": None,
"attribute_references": [
{
"attribute_id": 123,
"column_names": ["col9", "col9.foo.bar"]
}
]
},
"frequency_filter": {
"column_references": None,
"attribute_references": [
{
"attribute_id": 123,
"column_names": ["col9.foo.bar"]
}
],
"min_inclusive": 2,
"max_inclusive": 5
}
},
"auth_rules": { "company_constraint": {
"type": "inclusion",
"company_ids": [160, 1701]
} },
"created_by": 5000,
"created_at": "2021-06-29T10:58:36.726Z",
"updated_at": "2021-06-29T10:58:36.726Z",
"datasets": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'f94e8803-fc03-4c3e-a3fc-c3ffe3993788',
company_id: 100,
name: 'best data stream name',
slug: 'this-is-a-slug',
content: {
description: 'Fabulous Data Stream even better than anything out there!',
icon: 'https://some.icon.png',
sections: [
{title: 'some title', description: 'some description', image: 'some-image'},
{
whatever: 'whatever json structure FE would like to have here.',
free_form: 'json here'
}
]
},
tags: ['tag1', 'tag2'],
category: 'categoryA',
offers: [
{
id: '16310512-a8fb-4ce8-aec3-573693067df9',
channel: 'data_streams_market',
licensing: {period: 'P90D', license: {name: 'narrative opendata license'}},
pricing: {type: 'per_record', micro_cents_usd: 70000},
shops: null
},
{
id: 'd7542ec5-558f-4e98-9ff6-e049b24798fa',
channel: 'data_shop',
licensing: {period: 'P90D', license: {name: 'narrative opendata license'}},
pricing: {type: 'per_record', micro_cents_usd: 50000},
shops: null
},
{
id: '5d52d8d8-b683-4ef4-9220-31347dc2237f',
channel: 'data_shop',
licensing: {period: 'P90D', license: {name: 'narrative opendata license'}},
pricing: {type: 'max_price_per_record', micro_cents_usd: 30000},
shops: ['only.on.tld.com']
}
],
data_rules: {
column_sets: [
{
dataset_id: 99999,
fields: [
{field: 'col1', filter: null, exported: true},
{
field: 'col2',
filter: 'include_all_values_including_nulls_filter',
exported: true
},
{field: 'col3', filter: 'include_only_if_not_null_filter', exported: true},
{
field: 'col4',
filter: {type: 'include', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col5',
filter: {type: 'exclude', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col6',
filter: {
min: {type: 'inclusive', value: '-100'},
max: {type: 'inclusive', value: '100'}
},
exported: true
},
{
field: 'col6',
filter: {min: null, max: {type: 'exclusive', value: 'timestamp01'}},
exported: false
},
{field: 'col7', filter: {type: 'include', list: ['true']}, exported: true},
{
field: 'col8',
filter: {recency: 'P30D', from: null, to: {type: 'exclusive', value: 'timestamp01'}},
exported: true
}
]
}
],
attributes: [
{
attribute_id: 123,
fields: [
{field: 'col1', filter: null, exported: true},
{
field: 'col2',
filter: 'include_all_values_including_nulls_filter',
exported: true
},
{field: 'col3', filter: 'include_only_if_not_null_filter', exported: true},
{
field: 'col4',
filter: {type: 'include', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col5',
filter: {type: 'exclude', list: ['this', 'that', 'that too', 'some more']},
exported: true
},
{
field: 'col6',
filter: {
min: {type: 'inclusive', value: '-100'},
max: {type: 'inclusive', value: '100'}
},
exported: true
},
{
field: 'col6',
filter: {min: null, max: {type: 'exclusive', value: 'timestamp01'}},
exported: false
},
{field: 'col7', filter: {type: 'include', list: ['true']}, exported: true},
{
field: 'col8',
filter: {recency: 'P30D', from: null, to: {type: 'exclusive', value: 'timestamp01'}},
exported: true
},
{
field: 'col9',
filter: {expressions: ['col9 > -90', 'col9 < 90']},
exported: true
}
],
optional: true
},
{
attribute_id: 321,
fields: [
{
field: 'col9',
filter: {expressions: ['col9 > -90', 'col9 < 90']},
exported: false
}
],
optional: false
}
],
deduplication: {
period: 'P60D',
column_references: null,
attribute_references: [{attribute_id: 123, column_names: ['col9', 'col9.foo.bar']}]
},
frequency_filter: {
column_references: null,
attribute_references: [{attribute_id: 123, column_names: ['col9.foo.bar']}],
min_inclusive: 2,
max_inclusive: 5
}
},
auth_rules: {company_constraint: {type: 'inclusion', company_ids: [160, 1701]}},
created_by: 5000,
created_at: '2021-06-29T10:58:36.726Z',
updated_at: '2021-06-29T10:58:36.726Z',
datasets: null
})
};
fetch('https://api-dev.narrative.io/data-stream/{data_stream_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.narrative.io/data-stream/{data_stream_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'f94e8803-fc03-4c3e-a3fc-c3ffe3993788',
'company_id' => 100,
'name' => 'best data stream name',
'slug' => 'this-is-a-slug',
'content' => [
'description' => 'Fabulous Data Stream even better than anything out there!',
'icon' => 'https://some.icon.png',
'sections' => [
[
'title' => 'some title',
'description' => 'some description',
'image' => 'some-image'
],
[
'whatever' => 'whatever json structure FE would like to have here.',
'free_form' => 'json here'
]
]
],
'tags' => [
'tag1',
'tag2'
],
'category' => 'categoryA',
'offers' => [
[
'id' => '16310512-a8fb-4ce8-aec3-573693067df9',
'channel' => 'data_streams_market',
'licensing' => [
'period' => 'P90D',
'license' => [
'name' => 'narrative opendata license'
]
],
'pricing' => [
'type' => 'per_record',
'micro_cents_usd' => 70000
],
'shops' => null
],
[
'id' => 'd7542ec5-558f-4e98-9ff6-e049b24798fa',
'channel' => 'data_shop',
'licensing' => [
'period' => 'P90D',
'license' => [
'name' => 'narrative opendata license'
]
],
'pricing' => [
'type' => 'per_record',
'micro_cents_usd' => 50000
],
'shops' => null
],
[
'id' => '5d52d8d8-b683-4ef4-9220-31347dc2237f',
'channel' => 'data_shop',
'licensing' => [
'period' => 'P90D',
'license' => [
'name' => 'narrative opendata license'
]
],
'pricing' => [
'type' => 'max_price_per_record',
'micro_cents_usd' => 30000
],
'shops' => [
'only.on.tld.com'
]
]
],
'data_rules' => [
'column_sets' => [
[
'dataset_id' => 99999,
'fields' => [
[
'field' => 'col1',
'filter' => null,
'exported' => true
],
[
'field' => 'col2',
'filter' => 'include_all_values_including_nulls_filter',
'exported' => true
],
[
'field' => 'col3',
'filter' => 'include_only_if_not_null_filter',
'exported' => true
],
[
'field' => 'col4',
'filter' => [
'type' => 'include',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col5',
'filter' => [
'type' => 'exclude',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => [
'type' => 'inclusive',
'value' => '-100'
],
'max' => [
'type' => 'inclusive',
'value' => '100'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => null,
'max' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => false
],
[
'field' => 'col7',
'filter' => [
'type' => 'include',
'list' => [
'true'
]
],
'exported' => true
],
[
'field' => 'col8',
'filter' => [
'recency' => 'P30D',
'from' => null,
'to' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => true
]
]
]
],
'attributes' => [
[
'attribute_id' => 123,
'fields' => [
[
'field' => 'col1',
'filter' => null,
'exported' => true
],
[
'field' => 'col2',
'filter' => 'include_all_values_including_nulls_filter',
'exported' => true
],
[
'field' => 'col3',
'filter' => 'include_only_if_not_null_filter',
'exported' => true
],
[
'field' => 'col4',
'filter' => [
'type' => 'include',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col5',
'filter' => [
'type' => 'exclude',
'list' => [
'this',
'that',
'that too',
'some more'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => [
'type' => 'inclusive',
'value' => '-100'
],
'max' => [
'type' => 'inclusive',
'value' => '100'
]
],
'exported' => true
],
[
'field' => 'col6',
'filter' => [
'min' => null,
'max' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => false
],
[
'field' => 'col7',
'filter' => [
'type' => 'include',
'list' => [
'true'
]
],
'exported' => true
],
[
'field' => 'col8',
'filter' => [
'recency' => 'P30D',
'from' => null,
'to' => [
'type' => 'exclusive',
'value' => 'timestamp01'
]
],
'exported' => true
],
[
'field' => 'col9',
'filter' => [
'expressions' => [
'col9 > -90',
'col9 < 90'
]
],
'exported' => true
]
],
'optional' => true
],
[
'attribute_id' => 321,
'fields' => [
[
'field' => 'col9',
'filter' => [
'expressions' => [
'col9 > -90',
'col9 < 90'
]
],
'exported' => false
]
],
'optional' => false
]
],
'deduplication' => [
'period' => 'P60D',
'column_references' => null,
'attribute_references' => [
[
'attribute_id' => 123,
'column_names' => [
'col9',
'col9.foo.bar'
]
]
]
],
'frequency_filter' => [
'column_references' => null,
'attribute_references' => [
[
'attribute_id' => 123,
'column_names' => [
'col9.foo.bar'
]
]
],
'min_inclusive' => 2,
'max_inclusive' => 5
]
],
'auth_rules' => [
'company_constraint' => [
'type' => 'inclusion',
'company_ids' => [
160,
1701
]
]
],
'created_by' => 5000,
'created_at' => '2021-06-29T10:58:36.726Z',
'updated_at' => '2021-06-29T10:58:36.726Z',
'datasets' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/data-stream/{data_stream_id}"
payload := strings.NewReader("{\n \"id\": \"f94e8803-fc03-4c3e-a3fc-c3ffe3993788\",\n \"company_id\": 100,\n \"name\": \"best data stream name\",\n \"slug\": \"this-is-a-slug\",\n \"content\": {\n \"description\": \"Fabulous Data Stream even better than anything out there!\",\n \"icon\": \"https://some.icon.png\",\n \"sections\": [\n {\n \"title\": \"some title\",\n \"description\": \"some description\",\n \"image\": \"some-image\"\n },\n {\n \"whatever\": \"whatever json structure FE would like to have here.\",\n \"free_form\": \"json here\"\n }\n ]\n },\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"category\": \"categoryA\",\n \"offers\": [\n {\n \"id\": \"16310512-a8fb-4ce8-aec3-573693067df9\",\n \"channel\": \"data_streams_market\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 70000\n },\n \"shops\": null\n },\n {\n \"id\": \"d7542ec5-558f-4e98-9ff6-e049b24798fa\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 50000\n },\n \"shops\": null\n },\n {\n \"id\": \"5d52d8d8-b683-4ef4-9220-31347dc2237f\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"max_price_per_record\",\n \"micro_cents_usd\": 30000\n },\n \"shops\": [\n \"only.on.tld.com\"\n ]\n }\n ],\n \"data_rules\": {\n \"column_sets\": [\n {\n \"dataset_id\": 99999,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"attribute_id\": 123,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": true\n }\n ],\n \"optional\": true\n },\n {\n \"attribute_id\": 321,\n \"fields\": [\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": false\n }\n ],\n \"optional\": false\n }\n ],\n \"deduplication\": {\n \"period\": \"P60D\",\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9\",\n \"col9.foo.bar\"\n ]\n }\n ]\n },\n \"frequency_filter\": {\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9.foo.bar\"\n ]\n }\n ],\n \"min_inclusive\": 2,\n \"max_inclusive\": 5\n }\n },\n \"auth_rules\": {\n \"company_constraint\": {\n \"type\": \"inclusion\",\n \"company_ids\": [\n 160,\n 1701\n ]\n }\n },\n \"created_by\": 5000,\n \"created_at\": \"2021-06-29T10:58:36.726Z\",\n \"updated_at\": \"2021-06-29T10:58:36.726Z\",\n \"datasets\": null\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-dev.narrative.io/data-stream/{data_stream_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"f94e8803-fc03-4c3e-a3fc-c3ffe3993788\",\n \"company_id\": 100,\n \"name\": \"best data stream name\",\n \"slug\": \"this-is-a-slug\",\n \"content\": {\n \"description\": \"Fabulous Data Stream even better than anything out there!\",\n \"icon\": \"https://some.icon.png\",\n \"sections\": [\n {\n \"title\": \"some title\",\n \"description\": \"some description\",\n \"image\": \"some-image\"\n },\n {\n \"whatever\": \"whatever json structure FE would like to have here.\",\n \"free_form\": \"json here\"\n }\n ]\n },\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"category\": \"categoryA\",\n \"offers\": [\n {\n \"id\": \"16310512-a8fb-4ce8-aec3-573693067df9\",\n \"channel\": \"data_streams_market\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 70000\n },\n \"shops\": null\n },\n {\n \"id\": \"d7542ec5-558f-4e98-9ff6-e049b24798fa\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 50000\n },\n \"shops\": null\n },\n {\n \"id\": \"5d52d8d8-b683-4ef4-9220-31347dc2237f\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"max_price_per_record\",\n \"micro_cents_usd\": 30000\n },\n \"shops\": [\n \"only.on.tld.com\"\n ]\n }\n ],\n \"data_rules\": {\n \"column_sets\": [\n {\n \"dataset_id\": 99999,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"attribute_id\": 123,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": true\n }\n ],\n \"optional\": true\n },\n {\n \"attribute_id\": 321,\n \"fields\": [\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": false\n }\n ],\n \"optional\": false\n }\n ],\n \"deduplication\": {\n \"period\": \"P60D\",\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9\",\n \"col9.foo.bar\"\n ]\n }\n ]\n },\n \"frequency_filter\": {\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9.foo.bar\"\n ]\n }\n ],\n \"min_inclusive\": 2,\n \"max_inclusive\": 5\n }\n },\n \"auth_rules\": {\n \"company_constraint\": {\n \"type\": \"inclusion\",\n \"company_ids\": [\n 160,\n 1701\n ]\n }\n },\n \"created_by\": 5000,\n \"created_at\": \"2021-06-29T10:58:36.726Z\",\n \"updated_at\": \"2021-06-29T10:58:36.726Z\",\n \"datasets\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/data-stream/{data_stream_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"f94e8803-fc03-4c3e-a3fc-c3ffe3993788\",\n \"company_id\": 100,\n \"name\": \"best data stream name\",\n \"slug\": \"this-is-a-slug\",\n \"content\": {\n \"description\": \"Fabulous Data Stream even better than anything out there!\",\n \"icon\": \"https://some.icon.png\",\n \"sections\": [\n {\n \"title\": \"some title\",\n \"description\": \"some description\",\n \"image\": \"some-image\"\n },\n {\n \"whatever\": \"whatever json structure FE would like to have here.\",\n \"free_form\": \"json here\"\n }\n ]\n },\n \"tags\": [\n \"tag1\",\n \"tag2\"\n ],\n \"category\": \"categoryA\",\n \"offers\": [\n {\n \"id\": \"16310512-a8fb-4ce8-aec3-573693067df9\",\n \"channel\": \"data_streams_market\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 70000\n },\n \"shops\": null\n },\n {\n \"id\": \"d7542ec5-558f-4e98-9ff6-e049b24798fa\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"per_record\",\n \"micro_cents_usd\": 50000\n },\n \"shops\": null\n },\n {\n \"id\": \"5d52d8d8-b683-4ef4-9220-31347dc2237f\",\n \"channel\": \"data_shop\",\n \"licensing\": {\n \"period\": \"P90D\",\n \"license\": {\n \"name\": \"narrative opendata license\"\n }\n },\n \"pricing\": {\n \"type\": \"max_price_per_record\",\n \"micro_cents_usd\": 30000\n },\n \"shops\": [\n \"only.on.tld.com\"\n ]\n }\n ],\n \"data_rules\": {\n \"column_sets\": [\n {\n \"dataset_id\": 99999,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n }\n ]\n }\n ],\n \"attributes\": [\n {\n \"attribute_id\": 123,\n \"fields\": [\n {\n \"field\": \"col1\",\n \"filter\": null,\n \"exported\": true\n },\n {\n \"field\": \"col2\",\n \"filter\": \"include_all_values_including_nulls_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col3\",\n \"filter\": \"include_only_if_not_null_filter\",\n \"exported\": true\n },\n {\n \"field\": \"col4\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col5\",\n \"filter\": {\n \"type\": \"exclude\",\n \"list\": [\n \"this\",\n \"that\",\n \"that too\",\n \"some more\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": {\n \"type\": \"inclusive\",\n \"value\": \"-100\"\n },\n \"max\": {\n \"type\": \"inclusive\",\n \"value\": \"100\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col6\",\n \"filter\": {\n \"min\": null,\n \"max\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": false\n },\n {\n \"field\": \"col7\",\n \"filter\": {\n \"type\": \"include\",\n \"list\": [\n \"true\"\n ]\n },\n \"exported\": true\n },\n {\n \"field\": \"col8\",\n \"filter\": {\n \"recency\": \"P30D\",\n \"from\": null,\n \"to\": {\n \"type\": \"exclusive\",\n \"value\": \"timestamp01\"\n }\n },\n \"exported\": true\n },\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": true\n }\n ],\n \"optional\": true\n },\n {\n \"attribute_id\": 321,\n \"fields\": [\n {\n \"field\": \"col9\",\n \"filter\": {\n \"expressions\": [\n \"col9 > -90\",\n \"col9 < 90\"\n ]\n },\n \"exported\": false\n }\n ],\n \"optional\": false\n }\n ],\n \"deduplication\": {\n \"period\": \"P60D\",\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9\",\n \"col9.foo.bar\"\n ]\n }\n ]\n },\n \"frequency_filter\": {\n \"column_references\": null,\n \"attribute_references\": [\n {\n \"attribute_id\": 123,\n \"column_names\": [\n \"col9.foo.bar\"\n ]\n }\n ],\n \"min_inclusive\": 2,\n \"max_inclusive\": 5\n }\n },\n \"auth_rules\": {\n \"company_constraint\": {\n \"type\": \"inclusion\",\n \"company_ids\": [\n 160,\n 1701\n ]\n }\n },\n \"created_by\": 5000,\n \"created_at\": \"2021-06-29T10:58:36.726Z\",\n \"updated_at\": \"2021-06-29T10:58:36.726Z\",\n \"datasets\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "f94e8803-fc03-4c3e-a3fc-c3ffe3993788",
"company_id": 100,
"name": "best data stream name",
"slug": "this-is-a-slug",
"content": {
"description": "Fabulous Data Stream even better than anything out there!",
"icon": "https://some.icon.png",
"sections": [
{
"title": "some title",
"description": "some description",
"image": "some-image"
},
{
"whatever": "whatever json structure FE would like to have here.",
"free_form": "json here"
}
]
},
"tags": [
"tag1",
"tag2"
],
"category": "categoryA",
"offers": [
{
"id": "16310512-a8fb-4ce8-aec3-573693067df9",
"channel": "data_streams_market",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 70000
},
"shops": null
},
{
"id": "d7542ec5-558f-4e98-9ff6-e049b24798fa",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 50000
},
"shops": null
},
{
"id": "5d52d8d8-b683-4ef4-9220-31347dc2237f",
"channel": "data_shop",
"licensing": {
"period": "P90D",
"license": {
"name": "narrative opendata license"
}
},
"pricing": {
"type": "max_price_per_record",
"micro_cents_usd": 30000
},
"shops": [
"only.on.tld.com"
]
}
],
"data_rules": {
"column_sets": [
{
"dataset_id": 99999,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "col1",
"filter": null,
"exported": true
},
{
"field": "col2",
"filter": "include_all_values_including_nulls_filter",
"exported": true
},
{
"field": "col3",
"filter": "include_only_if_not_null_filter",
"exported": true
},
{
"field": "col4",
"filter": {
"type": "include",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col5",
"filter": {
"type": "exclude",
"list": [
"this",
"that",
"that too",
"some more"
]
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": {
"type": "inclusive",
"value": "-100"
},
"max": {
"type": "inclusive",
"value": "100"
}
},
"exported": true
},
{
"field": "col6",
"filter": {
"min": null,
"max": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": false
},
{
"field": "col7",
"filter": {
"type": "include",
"list": [
"true"
]
},
"exported": true
},
{
"field": "col8",
"filter": {
"recency": "P30D",
"from": null,
"to": {
"type": "exclusive",
"value": "timestamp01"
}
},
"exported": true
},
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": true
}
],
"optional": true
},
{
"attribute_id": 321,
"fields": [
{
"field": "col9",
"filter": {
"expressions": [
"col9 > -90",
"col9 < 90"
]
},
"exported": false
}
],
"optional": false
}
],
"deduplication": {
"period": "P60D",
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9",
"col9.foo.bar"
]
}
]
},
"frequency_filter": {
"column_references": null,
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"col9.foo.bar"
]
}
],
"min_inclusive": 2,
"max_inclusive": 5
}
},
"auth_rules": {
"company_constraint": {
"type": "inclusion",
"company_ids": [
160,
1701
]
}
},
"created_by": 5000,
"created_at": "2021-06-29T10:58:36.726Z",
"updated_at": "2021-06-29T10:58:36.726Z",
"datasets": null
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a data-stream.
Body
The id of an existing company
345
A name.
1The DataStream's slug. Used for SEO/URLs.
1^[a-zA-Z0-9-_.:]+$Show child attributes
Show child attributes
A tag. Useful for searching and cataloging
1The DataStream's category. Useful for searches and cataloging.
1Show child attributes
Show child attributes
Data rules capture the rules around how the data is handled within a data stream. The starting point might be an already predefined and active dataset(s) or the global data attributes on the platform.
Data rules might apply further filtering on the data being ingested and exported through the stream.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Unique id from a user who created it.
20
The instant this data-stream came into existence.
"2021-06-24T00:54:40.029056Z"
The instant this data-stream was last updated.
"2021-06-24T00:54:40.029056Z"
Response
OK
The id of an existing company
345
A name.
1The DataStream's slug. Used for SEO/URLs.
1^[a-zA-Z0-9-_.:]+$Show child attributes
Show child attributes
A tag. Useful for searching and cataloging
1The DataStream's category. Useful for searches and cataloging.
1Show child attributes
Show child attributes
Data rules capture the rules around how the data is handled within a data stream. The starting point might be an already predefined and active dataset(s) or the global data attributes on the platform.
Data rules might apply further filtering on the data being ingested and exported through the stream.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Unique id from a user who created it.
20
The instant this data-stream came into existence.
"2021-06-24T00:54:40.029056Z"
The instant this data-stream was last updated.
"2021-06-24T00:54:40.029056Z"
Was this page helpful?

