curl --request POST \
--url https://api.chartbrew.com/team/{team_id}/datasets/quick-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"team_id": 123,
"project_ids": [
123
],
"draft": true,
"name": "<string>",
"dimension": "<string>",
"metric": "<string>",
"metricOperation": "none",
"dateField": "<string>",
"dateFormat": "<string>",
"legend": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": true
}
],
"fieldsSchema": {},
"joinSettings": {
"joins": [
{
"dr_id": 123,
"join_id": 123,
"dr_field": "<string>",
"join_field": "<string>",
"alias": "<string>"
}
]
},
"dataRequests": [
{
"connection_id": 123,
"route": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"useGlobalHeaders": true,
"query": "<string>",
"pagination": false,
"itemsLimit": 0,
"offset": "offset",
"paginationField": "<string>",
"template": "<string>",
"conditions": [
{
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
],
"configuration": {
"populateAttributes": true,
"mainCollectionSample": "<string>",
"subCollectionSample": "<string>",
"selectedSubCollection": "<string>",
"limit": 123,
"orderBy": "<string>",
"accountId": "<string>",
"propertyId": "<string>",
"metrics": "<string>",
"dimensions": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"limitToLast": 123,
"limitToFirst": 123
},
"transform": {
"enabled": true,
"type": "<string>",
"configuration": {}
},
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": false
}
]
}
],
"main_dr_index": 0,
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": false
}
]
}
'import requests
url = "https://api.chartbrew.com/team/{team_id}/datasets/quick-create"
payload = {
"team_id": 123,
"project_ids": [123],
"draft": True,
"name": "<string>",
"dimension": "<string>",
"metric": "<string>",
"metricOperation": "none",
"dateField": "<string>",
"dateFormat": "<string>",
"legend": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": True
}
],
"fieldsSchema": {},
"joinSettings": { "joins": [
{
"dr_id": 123,
"join_id": 123,
"dr_field": "<string>",
"join_field": "<string>",
"alias": "<string>"
}
] },
"dataRequests": [
{
"connection_id": 123,
"route": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"useGlobalHeaders": True,
"query": "<string>",
"pagination": False,
"itemsLimit": 0,
"offset": "offset",
"paginationField": "<string>",
"template": "<string>",
"conditions": [
{
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
],
"configuration": {
"populateAttributes": True,
"mainCollectionSample": "<string>",
"subCollectionSample": "<string>",
"selectedSubCollection": "<string>",
"limit": 123,
"orderBy": "<string>",
"accountId": "<string>",
"propertyId": "<string>",
"metrics": "<string>",
"dimensions": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"limitToLast": 123,
"limitToFirst": 123
},
"transform": {
"enabled": True,
"type": "<string>",
"configuration": {}
},
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": False
}
]
}
],
"main_dr_index": 0,
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": False
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
team_id: 123,
project_ids: [123],
draft: true,
name: '<string>',
dimension: '<string>',
metric: '<string>',
metricOperation: 'none',
dateField: '<string>',
dateFormat: '<string>',
legend: '<string>',
conditions: [{id: '<string>', field: '<string>', value: '<string>', displayValues: true}],
fieldsSchema: {},
joinSettings: {
joins: [
{
dr_id: 123,
join_id: 123,
dr_field: '<string>',
join_field: '<string>',
alias: '<string>'
}
]
},
dataRequests: [
{
connection_id: 123,
route: '<string>',
headers: [{key: '<string>', value: '<string>'}],
body: JSON.stringify('<string>'),
useGlobalHeaders: true,
query: '<string>',
pagination: false,
itemsLimit: 0,
offset: 'offset',
paginationField: '<string>',
template: '<string>',
conditions: [{field: '<string>', operator: '<string>', value: '<string>'}],
configuration: {
populateAttributes: true,
mainCollectionSample: '<string>',
subCollectionSample: '<string>',
selectedSubCollection: '<string>',
limit: 123,
orderBy: '<string>',
accountId: '<string>',
propertyId: '<string>',
metrics: '<string>',
dimensions: '<string>',
startDate: '<string>',
endDate: '<string>',
limitToLast: 123,
limitToFirst: 123
},
transform: {enabled: true, type: '<string>', configuration: {}},
variableBindings: [{name: '<string>', default_value: '<string>', required: false}]
}
],
main_dr_index: 0,
variableBindings: [{name: '<string>', default_value: '<string>', required: false}]
})
};
fetch('https://api.chartbrew.com/team/{team_id}/datasets/quick-create', 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.chartbrew.com/team/{team_id}/datasets/quick-create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'team_id' => 123,
'project_ids' => [
123
],
'draft' => true,
'name' => '<string>',
'dimension' => '<string>',
'metric' => '<string>',
'metricOperation' => 'none',
'dateField' => '<string>',
'dateFormat' => '<string>',
'legend' => '<string>',
'conditions' => [
[
'id' => '<string>',
'field' => '<string>',
'value' => '<string>',
'displayValues' => true
]
],
'fieldsSchema' => [
],
'joinSettings' => [
'joins' => [
[
'dr_id' => 123,
'join_id' => 123,
'dr_field' => '<string>',
'join_field' => '<string>',
'alias' => '<string>'
]
]
],
'dataRequests' => [
[
'connection_id' => 123,
'route' => '<string>',
'headers' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'body' => '<string>',
'useGlobalHeaders' => true,
'query' => '<string>',
'pagination' => false,
'itemsLimit' => 0,
'offset' => 'offset',
'paginationField' => '<string>',
'template' => '<string>',
'conditions' => [
[
'field' => '<string>',
'operator' => '<string>',
'value' => '<string>'
]
],
'configuration' => [
'populateAttributes' => true,
'mainCollectionSample' => '<string>',
'subCollectionSample' => '<string>',
'selectedSubCollection' => '<string>',
'limit' => 123,
'orderBy' => '<string>',
'accountId' => '<string>',
'propertyId' => '<string>',
'metrics' => '<string>',
'dimensions' => '<string>',
'startDate' => '<string>',
'endDate' => '<string>',
'limitToLast' => 123,
'limitToFirst' => 123
],
'transform' => [
'enabled' => true,
'type' => '<string>',
'configuration' => [
]
],
'variableBindings' => [
[
'name' => '<string>',
'default_value' => '<string>',
'required' => false
]
]
]
],
'main_dr_index' => 0,
'variableBindings' => [
[
'name' => '<string>',
'default_value' => '<string>',
'required' => false
]
]
]),
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.chartbrew.com/team/{team_id}/datasets/quick-create"
payload := strings.NewReader("{\n \"team_id\": 123,\n \"project_ids\": [\n 123\n ],\n \"draft\": true,\n \"name\": \"<string>\",\n \"dimension\": \"<string>\",\n \"metric\": \"<string>\",\n \"metricOperation\": \"none\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"legend\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"fieldsSchema\": {},\n \"joinSettings\": {\n \"joins\": [\n {\n \"dr_id\": 123,\n \"join_id\": 123,\n \"dr_field\": \"<string>\",\n \"join_field\": \"<string>\",\n \"alias\": \"<string>\"\n }\n ]\n },\n \"dataRequests\": [\n {\n \"connection_id\": 123,\n \"route\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"useGlobalHeaders\": true,\n \"query\": \"<string>\",\n \"pagination\": false,\n \"itemsLimit\": 0,\n \"offset\": \"offset\",\n \"paginationField\": \"<string>\",\n \"template\": \"<string>\",\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"configuration\": {\n \"populateAttributes\": true,\n \"mainCollectionSample\": \"<string>\",\n \"subCollectionSample\": \"<string>\",\n \"selectedSubCollection\": \"<string>\",\n \"limit\": 123,\n \"orderBy\": \"<string>\",\n \"accountId\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"metrics\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"limitToLast\": 123,\n \"limitToFirst\": 123\n },\n \"transform\": {\n \"enabled\": true,\n \"type\": \"<string>\",\n \"configuration\": {}\n },\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n }\n ],\n \"main_dr_index\": 0,\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.chartbrew.com/team/{team_id}/datasets/quick-create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"team_id\": 123,\n \"project_ids\": [\n 123\n ],\n \"draft\": true,\n \"name\": \"<string>\",\n \"dimension\": \"<string>\",\n \"metric\": \"<string>\",\n \"metricOperation\": \"none\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"legend\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"fieldsSchema\": {},\n \"joinSettings\": {\n \"joins\": [\n {\n \"dr_id\": 123,\n \"join_id\": 123,\n \"dr_field\": \"<string>\",\n \"join_field\": \"<string>\",\n \"alias\": \"<string>\"\n }\n ]\n },\n \"dataRequests\": [\n {\n \"connection_id\": 123,\n \"route\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"useGlobalHeaders\": true,\n \"query\": \"<string>\",\n \"pagination\": false,\n \"itemsLimit\": 0,\n \"offset\": \"offset\",\n \"paginationField\": \"<string>\",\n \"template\": \"<string>\",\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"configuration\": {\n \"populateAttributes\": true,\n \"mainCollectionSample\": \"<string>\",\n \"subCollectionSample\": \"<string>\",\n \"selectedSubCollection\": \"<string>\",\n \"limit\": 123,\n \"orderBy\": \"<string>\",\n \"accountId\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"metrics\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"limitToLast\": 123,\n \"limitToFirst\": 123\n },\n \"transform\": {\n \"enabled\": true,\n \"type\": \"<string>\",\n \"configuration\": {}\n },\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n }\n ],\n \"main_dr_index\": 0,\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/team/{team_id}/datasets/quick-create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"team_id\": 123,\n \"project_ids\": [\n 123\n ],\n \"draft\": true,\n \"name\": \"<string>\",\n \"dimension\": \"<string>\",\n \"metric\": \"<string>\",\n \"metricOperation\": \"none\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"legend\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"fieldsSchema\": {},\n \"joinSettings\": {\n \"joins\": [\n {\n \"dr_id\": 123,\n \"join_id\": 123,\n \"dr_field\": \"<string>\",\n \"join_field\": \"<string>\",\n \"alias\": \"<string>\"\n }\n ]\n },\n \"dataRequests\": [\n {\n \"connection_id\": 123,\n \"route\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"useGlobalHeaders\": true,\n \"query\": \"<string>\",\n \"pagination\": false,\n \"itemsLimit\": 0,\n \"offset\": \"offset\",\n \"paginationField\": \"<string>\",\n \"template\": \"<string>\",\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"configuration\": {\n \"populateAttributes\": true,\n \"mainCollectionSample\": \"<string>\",\n \"subCollectionSample\": \"<string>\",\n \"selectedSubCollection\": \"<string>\",\n \"limit\": 123,\n \"orderBy\": \"<string>\",\n \"accountId\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"metrics\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"limitToLast\": 123,\n \"limitToFirst\": 123\n },\n \"transform\": {\n \"enabled\": true,\n \"type\": \"<string>\",\n \"configuration\": {}\n },\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n }\n ],\n \"main_dr_index\": 0,\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"team_id": 123,
"project_ids": [
123
],
"chart_id": 123,
"connection_id": 123,
"draft": true,
"name": "<string>",
"query": "<string>",
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"yAxisOperation": "none",
"dateField": "<string>",
"dateFormat": "<string>",
"legend": "<string>",
"fieldsSchema": {},
"excludedFields": [
"<string>"
],
"configuration": {},
"joinSettings": {
"joins": [
{
"dr_id": 123,
"join_id": 123,
"dr_field": "<string>",
"join_field": "<string>"
}
]
}
}Quick Create
Quick create a dataset with all its data requests in one go.
curl --request POST \
--url https://api.chartbrew.com/team/{team_id}/datasets/quick-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"team_id": 123,
"project_ids": [
123
],
"draft": true,
"name": "<string>",
"dimension": "<string>",
"metric": "<string>",
"metricOperation": "none",
"dateField": "<string>",
"dateFormat": "<string>",
"legend": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": true
}
],
"fieldsSchema": {},
"joinSettings": {
"joins": [
{
"dr_id": 123,
"join_id": 123,
"dr_field": "<string>",
"join_field": "<string>",
"alias": "<string>"
}
]
},
"dataRequests": [
{
"connection_id": 123,
"route": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"useGlobalHeaders": true,
"query": "<string>",
"pagination": false,
"itemsLimit": 0,
"offset": "offset",
"paginationField": "<string>",
"template": "<string>",
"conditions": [
{
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
],
"configuration": {
"populateAttributes": true,
"mainCollectionSample": "<string>",
"subCollectionSample": "<string>",
"selectedSubCollection": "<string>",
"limit": 123,
"orderBy": "<string>",
"accountId": "<string>",
"propertyId": "<string>",
"metrics": "<string>",
"dimensions": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"limitToLast": 123,
"limitToFirst": 123
},
"transform": {
"enabled": true,
"type": "<string>",
"configuration": {}
},
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": false
}
]
}
],
"main_dr_index": 0,
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": false
}
]
}
'import requests
url = "https://api.chartbrew.com/team/{team_id}/datasets/quick-create"
payload = {
"team_id": 123,
"project_ids": [123],
"draft": True,
"name": "<string>",
"dimension": "<string>",
"metric": "<string>",
"metricOperation": "none",
"dateField": "<string>",
"dateFormat": "<string>",
"legend": "<string>",
"conditions": [
{
"id": "<string>",
"field": "<string>",
"value": "<string>",
"displayValues": True
}
],
"fieldsSchema": {},
"joinSettings": { "joins": [
{
"dr_id": 123,
"join_id": 123,
"dr_field": "<string>",
"join_field": "<string>",
"alias": "<string>"
}
] },
"dataRequests": [
{
"connection_id": 123,
"route": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"useGlobalHeaders": True,
"query": "<string>",
"pagination": False,
"itemsLimit": 0,
"offset": "offset",
"paginationField": "<string>",
"template": "<string>",
"conditions": [
{
"field": "<string>",
"operator": "<string>",
"value": "<string>"
}
],
"configuration": {
"populateAttributes": True,
"mainCollectionSample": "<string>",
"subCollectionSample": "<string>",
"selectedSubCollection": "<string>",
"limit": 123,
"orderBy": "<string>",
"accountId": "<string>",
"propertyId": "<string>",
"metrics": "<string>",
"dimensions": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"limitToLast": 123,
"limitToFirst": 123
},
"transform": {
"enabled": True,
"type": "<string>",
"configuration": {}
},
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": False
}
]
}
],
"main_dr_index": 0,
"variableBindings": [
{
"name": "<string>",
"default_value": "<string>",
"required": False
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
team_id: 123,
project_ids: [123],
draft: true,
name: '<string>',
dimension: '<string>',
metric: '<string>',
metricOperation: 'none',
dateField: '<string>',
dateFormat: '<string>',
legend: '<string>',
conditions: [{id: '<string>', field: '<string>', value: '<string>', displayValues: true}],
fieldsSchema: {},
joinSettings: {
joins: [
{
dr_id: 123,
join_id: 123,
dr_field: '<string>',
join_field: '<string>',
alias: '<string>'
}
]
},
dataRequests: [
{
connection_id: 123,
route: '<string>',
headers: [{key: '<string>', value: '<string>'}],
body: JSON.stringify('<string>'),
useGlobalHeaders: true,
query: '<string>',
pagination: false,
itemsLimit: 0,
offset: 'offset',
paginationField: '<string>',
template: '<string>',
conditions: [{field: '<string>', operator: '<string>', value: '<string>'}],
configuration: {
populateAttributes: true,
mainCollectionSample: '<string>',
subCollectionSample: '<string>',
selectedSubCollection: '<string>',
limit: 123,
orderBy: '<string>',
accountId: '<string>',
propertyId: '<string>',
metrics: '<string>',
dimensions: '<string>',
startDate: '<string>',
endDate: '<string>',
limitToLast: 123,
limitToFirst: 123
},
transform: {enabled: true, type: '<string>', configuration: {}},
variableBindings: [{name: '<string>', default_value: '<string>', required: false}]
}
],
main_dr_index: 0,
variableBindings: [{name: '<string>', default_value: '<string>', required: false}]
})
};
fetch('https://api.chartbrew.com/team/{team_id}/datasets/quick-create', 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.chartbrew.com/team/{team_id}/datasets/quick-create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'team_id' => 123,
'project_ids' => [
123
],
'draft' => true,
'name' => '<string>',
'dimension' => '<string>',
'metric' => '<string>',
'metricOperation' => 'none',
'dateField' => '<string>',
'dateFormat' => '<string>',
'legend' => '<string>',
'conditions' => [
[
'id' => '<string>',
'field' => '<string>',
'value' => '<string>',
'displayValues' => true
]
],
'fieldsSchema' => [
],
'joinSettings' => [
'joins' => [
[
'dr_id' => 123,
'join_id' => 123,
'dr_field' => '<string>',
'join_field' => '<string>',
'alias' => '<string>'
]
]
],
'dataRequests' => [
[
'connection_id' => 123,
'route' => '<string>',
'headers' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'body' => '<string>',
'useGlobalHeaders' => true,
'query' => '<string>',
'pagination' => false,
'itemsLimit' => 0,
'offset' => 'offset',
'paginationField' => '<string>',
'template' => '<string>',
'conditions' => [
[
'field' => '<string>',
'operator' => '<string>',
'value' => '<string>'
]
],
'configuration' => [
'populateAttributes' => true,
'mainCollectionSample' => '<string>',
'subCollectionSample' => '<string>',
'selectedSubCollection' => '<string>',
'limit' => 123,
'orderBy' => '<string>',
'accountId' => '<string>',
'propertyId' => '<string>',
'metrics' => '<string>',
'dimensions' => '<string>',
'startDate' => '<string>',
'endDate' => '<string>',
'limitToLast' => 123,
'limitToFirst' => 123
],
'transform' => [
'enabled' => true,
'type' => '<string>',
'configuration' => [
]
],
'variableBindings' => [
[
'name' => '<string>',
'default_value' => '<string>',
'required' => false
]
]
]
],
'main_dr_index' => 0,
'variableBindings' => [
[
'name' => '<string>',
'default_value' => '<string>',
'required' => false
]
]
]),
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.chartbrew.com/team/{team_id}/datasets/quick-create"
payload := strings.NewReader("{\n \"team_id\": 123,\n \"project_ids\": [\n 123\n ],\n \"draft\": true,\n \"name\": \"<string>\",\n \"dimension\": \"<string>\",\n \"metric\": \"<string>\",\n \"metricOperation\": \"none\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"legend\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"fieldsSchema\": {},\n \"joinSettings\": {\n \"joins\": [\n {\n \"dr_id\": 123,\n \"join_id\": 123,\n \"dr_field\": \"<string>\",\n \"join_field\": \"<string>\",\n \"alias\": \"<string>\"\n }\n ]\n },\n \"dataRequests\": [\n {\n \"connection_id\": 123,\n \"route\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"useGlobalHeaders\": true,\n \"query\": \"<string>\",\n \"pagination\": false,\n \"itemsLimit\": 0,\n \"offset\": \"offset\",\n \"paginationField\": \"<string>\",\n \"template\": \"<string>\",\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"configuration\": {\n \"populateAttributes\": true,\n \"mainCollectionSample\": \"<string>\",\n \"subCollectionSample\": \"<string>\",\n \"selectedSubCollection\": \"<string>\",\n \"limit\": 123,\n \"orderBy\": \"<string>\",\n \"accountId\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"metrics\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"limitToLast\": 123,\n \"limitToFirst\": 123\n },\n \"transform\": {\n \"enabled\": true,\n \"type\": \"<string>\",\n \"configuration\": {}\n },\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n }\n ],\n \"main_dr_index\": 0,\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.chartbrew.com/team/{team_id}/datasets/quick-create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"team_id\": 123,\n \"project_ids\": [\n 123\n ],\n \"draft\": true,\n \"name\": \"<string>\",\n \"dimension\": \"<string>\",\n \"metric\": \"<string>\",\n \"metricOperation\": \"none\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"legend\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"fieldsSchema\": {},\n \"joinSettings\": {\n \"joins\": [\n {\n \"dr_id\": 123,\n \"join_id\": 123,\n \"dr_field\": \"<string>\",\n \"join_field\": \"<string>\",\n \"alias\": \"<string>\"\n }\n ]\n },\n \"dataRequests\": [\n {\n \"connection_id\": 123,\n \"route\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"useGlobalHeaders\": true,\n \"query\": \"<string>\",\n \"pagination\": false,\n \"itemsLimit\": 0,\n \"offset\": \"offset\",\n \"paginationField\": \"<string>\",\n \"template\": \"<string>\",\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"configuration\": {\n \"populateAttributes\": true,\n \"mainCollectionSample\": \"<string>\",\n \"subCollectionSample\": \"<string>\",\n \"selectedSubCollection\": \"<string>\",\n \"limit\": 123,\n \"orderBy\": \"<string>\",\n \"accountId\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"metrics\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"limitToLast\": 123,\n \"limitToFirst\": 123\n },\n \"transform\": {\n \"enabled\": true,\n \"type\": \"<string>\",\n \"configuration\": {}\n },\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n }\n ],\n \"main_dr_index\": 0,\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/team/{team_id}/datasets/quick-create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"team_id\": 123,\n \"project_ids\": [\n 123\n ],\n \"draft\": true,\n \"name\": \"<string>\",\n \"dimension\": \"<string>\",\n \"metric\": \"<string>\",\n \"metricOperation\": \"none\",\n \"dateField\": \"<string>\",\n \"dateFormat\": \"<string>\",\n \"legend\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"field\": \"<string>\",\n \"value\": \"<string>\",\n \"displayValues\": true\n }\n ],\n \"fieldsSchema\": {},\n \"joinSettings\": {\n \"joins\": [\n {\n \"dr_id\": 123,\n \"join_id\": 123,\n \"dr_field\": \"<string>\",\n \"join_field\": \"<string>\",\n \"alias\": \"<string>\"\n }\n ]\n },\n \"dataRequests\": [\n {\n \"connection_id\": 123,\n \"route\": \"<string>\",\n \"headers\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"useGlobalHeaders\": true,\n \"query\": \"<string>\",\n \"pagination\": false,\n \"itemsLimit\": 0,\n \"offset\": \"offset\",\n \"paginationField\": \"<string>\",\n \"template\": \"<string>\",\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"operator\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"configuration\": {\n \"populateAttributes\": true,\n \"mainCollectionSample\": \"<string>\",\n \"subCollectionSample\": \"<string>\",\n \"selectedSubCollection\": \"<string>\",\n \"limit\": 123,\n \"orderBy\": \"<string>\",\n \"accountId\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"metrics\": \"<string>\",\n \"dimensions\": \"<string>\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\",\n \"limitToLast\": 123,\n \"limitToFirst\": 123\n },\n \"transform\": {\n \"enabled\": true,\n \"type\": \"<string>\",\n \"configuration\": {}\n },\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n }\n ],\n \"main_dr_index\": 0,\n \"variableBindings\": [\n {\n \"name\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"team_id": 123,
"project_ids": [
123
],
"chart_id": 123,
"connection_id": 123,
"draft": true,
"name": "<string>",
"query": "<string>",
"xAxis": "<string>",
"xAxisOperation": "<string>",
"yAxis": "<string>",
"yAxisOperation": "none",
"dateField": "<string>",
"dateFormat": "<string>",
"legend": "<string>",
"fieldsSchema": {},
"excludedFields": [
"<string>"
],
"configuration": {},
"joinSettings": {
"joins": [
{
"dr_id": 123,
"join_id": 123,
"dr_field": "<string>",
"join_field": "<string>"
}
]
}
}name as the canonical dataset name.dimension, metric, metricOperation, dateField, dateFormat, conditions, and legend are still accepted for compatibility, but new chart-specific bindings should be added to chartDatasetConfigs[] on the chart quick-create flow instead of the dataset.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the team
Body
Create a dataset with all its data requests in one API call. This endpoint is dataset-focused. Per-chart bindings should be configured on ChartDatasetConfig when creating or updating charts.
ID of the team
Array of project IDs where members can access the dataset
Whether the dataset is a draft and should be hidden from dashboard viewers
Canonical dataset name.
[Legacy compatibility] Dataset-level xAxis fallback. New per-chart bindings should be set on chartDatasetConfigs[].xAxis.
[Legacy compatibility] Dataset-level yAxis fallback. New per-chart bindings should be set on chartDatasetConfigs[].yAxis.
[Legacy compatibility] Dataset-level yAxisOperation fallback. New per-chart bindings should be set on chartDatasetConfigs[].yAxisOperation.
none, count, count_unique, sum, avg, min, max [Legacy compatibility] Dataset-level dateField fallback. New per-chart bindings should be set on chartDatasetConfigs[].dateField.
[Legacy compatibility] Dataset-level dateFormat fallback. New per-chart bindings should be set on chartDatasetConfigs[].dateFormat.
[Legacy compatibility] Previous dataset name field. Prefer name for reusable dataset naming.
[Legacy compatibility] Dataset-level filter fallback. New chart-specific filters should be set on chartDatasetConfigs[].conditions.
Show child attributes
Show child attributes
Schema of the fields in the dataset key(field name) => value(type). This gets populated automatically whenever the dataset is used in a chart.
Join settings for the dataset. Use indices (0-based) in joins array to reference data requests before they are created.
Show child attributes
Show child attributes
Array of data requests to create with the dataset
Show child attributes
Show child attributes
Index (0-based) of the main data request in the dataRequests array. Defaults to 0.
Variable bindings for the dataset. The entity_type and entity_id will be automatically set.
Show child attributes
Show child attributes
Response
Created dataset with all data requests
Canonical dataset name. Prefer this over legend when referring to the reusable dataset itself.
[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.
[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.
[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.
[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.
[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.
[Legacy compatibility] Dataset-level binding fallback. New chart bindings should be stored on ChartDatasetConfig.
[Legacy compatibility] Previous dataset name field. Prefer Dataset.name for reusable dataset naming.
Show child attributes
Show child attributes