v1 Create Chart
curl --request POST \
--url http://api.globalwebindex.com/v1/charts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": [
{
"datapoint_code": "<string>",
"namespace_code": "<string>",
"question_code": "<string>",
"suffix_code": "<string>"
}
],
"audiences": [
{
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": [
"<string>"
],
"min_count": 123,
"not": true,
"or": "<array>",
"question": "<string>",
"suffixes": [
"<unknown>"
]
},
"id": "<string>",
"is_hidden": true,
"name": "<string>"
}
],
"base_audience": {
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": [
"<string>"
],
"min_count": 123,
"not": true,
"or": "<array>",
"question": "<string>",
"suffixes": [
"<unknown>"
]
},
"id": "<string>",
"is_hidden": true,
"name": "<string>"
},
"color": "<string>",
"dataset_codes": [
"<string>"
],
"dataset_names": [
"<string>"
],
"folder_id": "<string>",
"group_type": 123,
"location_codes": [
"<string>"
],
"metrics": [
"<string>"
],
"name": "<string>",
"segmented_base": true,
"segments": [
"<string>"
],
"sort_parameter_type": 123,
"sort_parameter_value": "<string>",
"sort_type": 123,
"splitter": "<string>",
"view_type": 123,
"wave_codes": [
"<string>"
]
}
'import requests
url = "http://api.globalwebindex.com/v1/charts"
payload = {
"attributes": [
{
"datapoint_code": "<string>",
"namespace_code": "<string>",
"question_code": "<string>",
"suffix_code": "<string>"
}
],
"audiences": [
{
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": ["<string>"],
"min_count": 123,
"not": True,
"or": "<array>",
"question": "<string>",
"suffixes": ["<unknown>"]
},
"id": "<string>",
"is_hidden": True,
"name": "<string>"
}
],
"base_audience": {
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": ["<string>"],
"min_count": 123,
"not": True,
"or": "<array>",
"question": "<string>",
"suffixes": ["<unknown>"]
},
"id": "<string>",
"is_hidden": True,
"name": "<string>"
},
"color": "<string>",
"dataset_codes": ["<string>"],
"dataset_names": ["<string>"],
"folder_id": "<string>",
"group_type": 123,
"location_codes": ["<string>"],
"metrics": ["<string>"],
"name": "<string>",
"segmented_base": True,
"segments": ["<string>"],
"sort_parameter_type": 123,
"sort_parameter_value": "<string>",
"sort_type": 123,
"splitter": "<string>",
"view_type": 123,
"wave_codes": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attributes: [
{
datapoint_code: '<string>',
namespace_code: '<string>',
question_code: '<string>',
suffix_code: '<string>'
}
],
audiences: [
{
color_index: 123,
expression: {
and: '<array>',
datapoints: ['<string>'],
min_count: 123,
not: true,
or: '<array>',
question: '<string>',
suffixes: ['<unknown>']
},
id: '<string>',
is_hidden: true,
name: '<string>'
}
],
base_audience: {
color_index: 123,
expression: {
and: '<array>',
datapoints: ['<string>'],
min_count: 123,
not: true,
or: '<array>',
question: '<string>',
suffixes: ['<unknown>']
},
id: '<string>',
is_hidden: true,
name: '<string>'
},
color: '<string>',
dataset_codes: ['<string>'],
dataset_names: ['<string>'],
folder_id: '<string>',
group_type: 123,
location_codes: ['<string>'],
metrics: ['<string>'],
name: '<string>',
segmented_base: true,
segments: ['<string>'],
sort_parameter_type: 123,
sort_parameter_value: '<string>',
sort_type: 123,
splitter: '<string>',
view_type: 123,
wave_codes: ['<string>']
})
};
fetch('http://api.globalwebindex.com/v1/charts', 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 => "http://api.globalwebindex.com/v1/charts",
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([
'attributes' => [
[
'datapoint_code' => '<string>',
'namespace_code' => '<string>',
'question_code' => '<string>',
'suffix_code' => '<string>'
]
],
'audiences' => [
[
'color_index' => 123,
'expression' => [
'and' => '<array>',
'datapoints' => [
'<string>'
],
'min_count' => 123,
'not' => true,
'or' => '<array>',
'question' => '<string>',
'suffixes' => [
'<unknown>'
]
],
'id' => '<string>',
'is_hidden' => true,
'name' => '<string>'
]
],
'base_audience' => [
'color_index' => 123,
'expression' => [
'and' => '<array>',
'datapoints' => [
'<string>'
],
'min_count' => 123,
'not' => true,
'or' => '<array>',
'question' => '<string>',
'suffixes' => [
'<unknown>'
]
],
'id' => '<string>',
'is_hidden' => true,
'name' => '<string>'
],
'color' => '<string>',
'dataset_codes' => [
'<string>'
],
'dataset_names' => [
'<string>'
],
'folder_id' => '<string>',
'group_type' => 123,
'location_codes' => [
'<string>'
],
'metrics' => [
'<string>'
],
'name' => '<string>',
'segmented_base' => true,
'segments' => [
'<string>'
],
'sort_parameter_type' => 123,
'sort_parameter_value' => '<string>',
'sort_type' => 123,
'splitter' => '<string>',
'view_type' => 123,
'wave_codes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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 := "http://api.globalwebindex.com/v1/charts"
payload := strings.NewReader("{\n \"attributes\": [\n {\n \"datapoint_code\": \"<string>\",\n \"namespace_code\": \"<string>\",\n \"question_code\": \"<string>\",\n \"suffix_code\": \"<string>\"\n }\n ],\n \"audiences\": [\n {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n }\n ],\n \"base_audience\": {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n },\n \"color\": \"<string>\",\n \"dataset_codes\": [\n \"<string>\"\n ],\n \"dataset_names\": [\n \"<string>\"\n ],\n \"folder_id\": \"<string>\",\n \"group_type\": 123,\n \"location_codes\": [\n \"<string>\"\n ],\n \"metrics\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"segmented_base\": true,\n \"segments\": [\n \"<string>\"\n ],\n \"sort_parameter_type\": 123,\n \"sort_parameter_value\": \"<string>\",\n \"sort_type\": 123,\n \"splitter\": \"<string>\",\n \"view_type\": 123,\n \"wave_codes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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("http://api.globalwebindex.com/v1/charts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": [\n {\n \"datapoint_code\": \"<string>\",\n \"namespace_code\": \"<string>\",\n \"question_code\": \"<string>\",\n \"suffix_code\": \"<string>\"\n }\n ],\n \"audiences\": [\n {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n }\n ],\n \"base_audience\": {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n },\n \"color\": \"<string>\",\n \"dataset_codes\": [\n \"<string>\"\n ],\n \"dataset_names\": [\n \"<string>\"\n ],\n \"folder_id\": \"<string>\",\n \"group_type\": 123,\n \"location_codes\": [\n \"<string>\"\n ],\n \"metrics\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"segmented_base\": true,\n \"segments\": [\n \"<string>\"\n ],\n \"sort_parameter_type\": 123,\n \"sort_parameter_value\": \"<string>\",\n \"sort_type\": 123,\n \"splitter\": \"<string>\",\n \"view_type\": 123,\n \"wave_codes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.globalwebindex.com/v1/charts")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributes\": [\n {\n \"datapoint_code\": \"<string>\",\n \"namespace_code\": \"<string>\",\n \"question_code\": \"<string>\",\n \"suffix_code\": \"<string>\"\n }\n ],\n \"audiences\": [\n {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n }\n ],\n \"base_audience\": {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n },\n \"color\": \"<string>\",\n \"dataset_codes\": [\n \"<string>\"\n ],\n \"dataset_names\": [\n \"<string>\"\n ],\n \"folder_id\": \"<string>\",\n \"group_type\": 123,\n \"location_codes\": [\n \"<string>\"\n ],\n \"metrics\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"segmented_base\": true,\n \"segments\": [\n \"<string>\"\n ],\n \"sort_parameter_type\": 123,\n \"sort_parameter_value\": \"<string>\",\n \"sort_type\": 123,\n \"splitter\": \"<string>\",\n \"view_type\": 123,\n \"wave_codes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"audience_replacements": [
{
"from": "<string>",
"to": "<string>"
}
],
"id": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Charts
v1 Create Chart
Create user’s chart. If audiences on this chart are not accessible for the user, it creates new ones.
POST
/
v1
/
charts
v1 Create Chart
curl --request POST \
--url http://api.globalwebindex.com/v1/charts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"attributes": [
{
"datapoint_code": "<string>",
"namespace_code": "<string>",
"question_code": "<string>",
"suffix_code": "<string>"
}
],
"audiences": [
{
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": [
"<string>"
],
"min_count": 123,
"not": true,
"or": "<array>",
"question": "<string>",
"suffixes": [
"<unknown>"
]
},
"id": "<string>",
"is_hidden": true,
"name": "<string>"
}
],
"base_audience": {
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": [
"<string>"
],
"min_count": 123,
"not": true,
"or": "<array>",
"question": "<string>",
"suffixes": [
"<unknown>"
]
},
"id": "<string>",
"is_hidden": true,
"name": "<string>"
},
"color": "<string>",
"dataset_codes": [
"<string>"
],
"dataset_names": [
"<string>"
],
"folder_id": "<string>",
"group_type": 123,
"location_codes": [
"<string>"
],
"metrics": [
"<string>"
],
"name": "<string>",
"segmented_base": true,
"segments": [
"<string>"
],
"sort_parameter_type": 123,
"sort_parameter_value": "<string>",
"sort_type": 123,
"splitter": "<string>",
"view_type": 123,
"wave_codes": [
"<string>"
]
}
'import requests
url = "http://api.globalwebindex.com/v1/charts"
payload = {
"attributes": [
{
"datapoint_code": "<string>",
"namespace_code": "<string>",
"question_code": "<string>",
"suffix_code": "<string>"
}
],
"audiences": [
{
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": ["<string>"],
"min_count": 123,
"not": True,
"or": "<array>",
"question": "<string>",
"suffixes": ["<unknown>"]
},
"id": "<string>",
"is_hidden": True,
"name": "<string>"
}
],
"base_audience": {
"color_index": 123,
"expression": {
"and": "<array>",
"datapoints": ["<string>"],
"min_count": 123,
"not": True,
"or": "<array>",
"question": "<string>",
"suffixes": ["<unknown>"]
},
"id": "<string>",
"is_hidden": True,
"name": "<string>"
},
"color": "<string>",
"dataset_codes": ["<string>"],
"dataset_names": ["<string>"],
"folder_id": "<string>",
"group_type": 123,
"location_codes": ["<string>"],
"metrics": ["<string>"],
"name": "<string>",
"segmented_base": True,
"segments": ["<string>"],
"sort_parameter_type": 123,
"sort_parameter_value": "<string>",
"sort_type": 123,
"splitter": "<string>",
"view_type": 123,
"wave_codes": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attributes: [
{
datapoint_code: '<string>',
namespace_code: '<string>',
question_code: '<string>',
suffix_code: '<string>'
}
],
audiences: [
{
color_index: 123,
expression: {
and: '<array>',
datapoints: ['<string>'],
min_count: 123,
not: true,
or: '<array>',
question: '<string>',
suffixes: ['<unknown>']
},
id: '<string>',
is_hidden: true,
name: '<string>'
}
],
base_audience: {
color_index: 123,
expression: {
and: '<array>',
datapoints: ['<string>'],
min_count: 123,
not: true,
or: '<array>',
question: '<string>',
suffixes: ['<unknown>']
},
id: '<string>',
is_hidden: true,
name: '<string>'
},
color: '<string>',
dataset_codes: ['<string>'],
dataset_names: ['<string>'],
folder_id: '<string>',
group_type: 123,
location_codes: ['<string>'],
metrics: ['<string>'],
name: '<string>',
segmented_base: true,
segments: ['<string>'],
sort_parameter_type: 123,
sort_parameter_value: '<string>',
sort_type: 123,
splitter: '<string>',
view_type: 123,
wave_codes: ['<string>']
})
};
fetch('http://api.globalwebindex.com/v1/charts', 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 => "http://api.globalwebindex.com/v1/charts",
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([
'attributes' => [
[
'datapoint_code' => '<string>',
'namespace_code' => '<string>',
'question_code' => '<string>',
'suffix_code' => '<string>'
]
],
'audiences' => [
[
'color_index' => 123,
'expression' => [
'and' => '<array>',
'datapoints' => [
'<string>'
],
'min_count' => 123,
'not' => true,
'or' => '<array>',
'question' => '<string>',
'suffixes' => [
'<unknown>'
]
],
'id' => '<string>',
'is_hidden' => true,
'name' => '<string>'
]
],
'base_audience' => [
'color_index' => 123,
'expression' => [
'and' => '<array>',
'datapoints' => [
'<string>'
],
'min_count' => 123,
'not' => true,
'or' => '<array>',
'question' => '<string>',
'suffixes' => [
'<unknown>'
]
],
'id' => '<string>',
'is_hidden' => true,
'name' => '<string>'
],
'color' => '<string>',
'dataset_codes' => [
'<string>'
],
'dataset_names' => [
'<string>'
],
'folder_id' => '<string>',
'group_type' => 123,
'location_codes' => [
'<string>'
],
'metrics' => [
'<string>'
],
'name' => '<string>',
'segmented_base' => true,
'segments' => [
'<string>'
],
'sort_parameter_type' => 123,
'sort_parameter_value' => '<string>',
'sort_type' => 123,
'splitter' => '<string>',
'view_type' => 123,
'wave_codes' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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 := "http://api.globalwebindex.com/v1/charts"
payload := strings.NewReader("{\n \"attributes\": [\n {\n \"datapoint_code\": \"<string>\",\n \"namespace_code\": \"<string>\",\n \"question_code\": \"<string>\",\n \"suffix_code\": \"<string>\"\n }\n ],\n \"audiences\": [\n {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n }\n ],\n \"base_audience\": {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n },\n \"color\": \"<string>\",\n \"dataset_codes\": [\n \"<string>\"\n ],\n \"dataset_names\": [\n \"<string>\"\n ],\n \"folder_id\": \"<string>\",\n \"group_type\": 123,\n \"location_codes\": [\n \"<string>\"\n ],\n \"metrics\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"segmented_base\": true,\n \"segments\": [\n \"<string>\"\n ],\n \"sort_parameter_type\": 123,\n \"sort_parameter_value\": \"<string>\",\n \"sort_type\": 123,\n \"splitter\": \"<string>\",\n \"view_type\": 123,\n \"wave_codes\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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("http://api.globalwebindex.com/v1/charts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"attributes\": [\n {\n \"datapoint_code\": \"<string>\",\n \"namespace_code\": \"<string>\",\n \"question_code\": \"<string>\",\n \"suffix_code\": \"<string>\"\n }\n ],\n \"audiences\": [\n {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n }\n ],\n \"base_audience\": {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n },\n \"color\": \"<string>\",\n \"dataset_codes\": [\n \"<string>\"\n ],\n \"dataset_names\": [\n \"<string>\"\n ],\n \"folder_id\": \"<string>\",\n \"group_type\": 123,\n \"location_codes\": [\n \"<string>\"\n ],\n \"metrics\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"segmented_base\": true,\n \"segments\": [\n \"<string>\"\n ],\n \"sort_parameter_type\": 123,\n \"sort_parameter_value\": \"<string>\",\n \"sort_type\": 123,\n \"splitter\": \"<string>\",\n \"view_type\": 123,\n \"wave_codes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.globalwebindex.com/v1/charts")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attributes\": [\n {\n \"datapoint_code\": \"<string>\",\n \"namespace_code\": \"<string>\",\n \"question_code\": \"<string>\",\n \"suffix_code\": \"<string>\"\n }\n ],\n \"audiences\": [\n {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n }\n ],\n \"base_audience\": {\n \"color_index\": 123,\n \"expression\": {\n \"and\": \"<array>\",\n \"datapoints\": [\n \"<string>\"\n ],\n \"min_count\": 123,\n \"not\": true,\n \"or\": \"<array>\",\n \"question\": \"<string>\",\n \"suffixes\": [\n \"<unknown>\"\n ]\n },\n \"id\": \"<string>\",\n \"is_hidden\": true,\n \"name\": \"<string>\"\n },\n \"color\": \"<string>\",\n \"dataset_codes\": [\n \"<string>\"\n ],\n \"dataset_names\": [\n \"<string>\"\n ],\n \"folder_id\": \"<string>\",\n \"group_type\": 123,\n \"location_codes\": [\n \"<string>\"\n ],\n \"metrics\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"segmented_base\": true,\n \"segments\": [\n \"<string>\"\n ],\n \"sort_parameter_type\": 123,\n \"sort_parameter_value\": \"<string>\",\n \"sort_type\": 123,\n \"splitter\": \"<string>\",\n \"view_type\": 123,\n \"wave_codes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"audience_replacements": [
{
"from": "<string>",
"to": "<string>"
}
],
"id": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
JWT token for authentication
Body
application/json
Chart to create.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I

