Create a new variable binding
curl --request POST \
--url https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"entity_id": "<string>",
"name": "<string>",
"type": "<string>",
"default_value": "<string>",
"required": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings"
payload = {
"id": 123,
"entity_id": "<string>",
"name": "<string>",
"type": "<string>",
"default_value": "<string>",
"required": True,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
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({
id: 123,
entity_id: '<string>',
name: '<string>',
type: '<string>',
default_value: '<string>',
required: true,
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings', 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/{dataset_id}/dataRequests/{id}/variableBindings",
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([
'id' => 123,
'entity_id' => '<string>',
'name' => '<string>',
'type' => '<string>',
'default_value' => '<string>',
'required' => true,
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z'
]),
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/{dataset_id}/dataRequests/{id}/variableBindings"
payload := strings.NewReader("{\n \"id\": 123,\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": true,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\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/{dataset_id}/dataRequests/{id}/variableBindings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 123,\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": true,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings")
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 \"id\": 123,\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": true,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"dataset_id": 123,
"connection_id": 123,
"route": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"useGlobalHeaders": true,
"query": "<string>",
"pagination": false,
"items": "items",
"itemsLimit": 0,
"offset": "offset",
"paginationField": "<string>",
"template": "<string>",
"conditions": [
{
"field": "<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
},
"variables": {},
"Connection": {
"id": 123,
"name": "<string>",
"type": "<string>",
"subType": "<string>",
"host": "<string>"
},
"VariableBindings": [
{
"id": 123,
"entity_id": "<string>",
"name": "<string>",
"type": "<string>",
"default_value": "<string>",
"required": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}Data Requests
Create a Variable Binding
Create a variable binding
POST
/
team
/
{team_id}
/
datasets
/
{dataset_id}
/
dataRequests
/
{id}
/
variableBindings
Create a new variable binding
curl --request POST \
--url https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"entity_id": "<string>",
"name": "<string>",
"type": "<string>",
"default_value": "<string>",
"required": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings"
payload = {
"id": 123,
"entity_id": "<string>",
"name": "<string>",
"type": "<string>",
"default_value": "<string>",
"required": True,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
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({
id: 123,
entity_id: '<string>',
name: '<string>',
type: '<string>',
default_value: '<string>',
required: true,
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings', 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/{dataset_id}/dataRequests/{id}/variableBindings",
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([
'id' => 123,
'entity_id' => '<string>',
'name' => '<string>',
'type' => '<string>',
'default_value' => '<string>',
'required' => true,
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z'
]),
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/{dataset_id}/dataRequests/{id}/variableBindings"
payload := strings.NewReader("{\n \"id\": 123,\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": true,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\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/{dataset_id}/dataRequests/{id}/variableBindings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 123,\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": true,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chartbrew.com/team/{team_id}/datasets/{dataset_id}/dataRequests/{id}/variableBindings")
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 \"id\": 123,\n \"entity_id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"default_value\": \"<string>\",\n \"required\": true,\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"dataset_id": 123,
"connection_id": 123,
"route": "<string>",
"headers": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"useGlobalHeaders": true,
"query": "<string>",
"pagination": false,
"items": "items",
"itemsLimit": 0,
"offset": "offset",
"paginationField": "<string>",
"template": "<string>",
"conditions": [
{
"field": "<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
},
"variables": {},
"Connection": {
"id": 123,
"name": "<string>",
"type": "<string>",
"subType": "<string>",
"host": "<string>"
},
"VariableBindings": [
{
"id": 123,
"entity_id": "<string>",
"name": "<string>",
"type": "<string>",
"default_value": "<string>",
"required": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
200 - application/json
Variable binding created successfully
Reference to Dataset model
Reference to Connection model
Available options:
GET, POST, PUT, DELETE, PATCH API endpoint path
Show child attributes
Show child attributes
Request body in JSON string format
Path to items array in response
Maximum number of items to return
Pagination offset field name
Field used for pagination
Template type for request formatting
Show child attributes
Show child attributes
Configuration options for data requests. Fields vary by connection type. Only include fields relevant to your connection type.
Show child attributes
Show child attributes
Request variables
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I