curl --request POST \
--url http://10.2.4.166:8080/composer/api/sources/import \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/vnd.composer.v3+json' \
--data '
{
"version": "<string>",
"importSettings": {
"objectClassLevel": {},
"objectLevel": {
"visuals": {},
"connections": {},
"sources": {},
"dashboards": {}
},
"warningTags": [
"<string>"
]
},
"connections": [
{
"name": "<string>",
"type": "<string>",
"subStorageType": "<string>",
"id": "<string>",
"accountId": "<string>",
"creatingUserName": "<string>",
"disabled": true,
"connectionTypeId": "<string>",
"allParameters": [
{
"key": "<string>",
"value": "<string>",
"isSystemAccess": true,
"systemAccess": true
}
],
"folderId": 1111
}
],
"sources": [
{
"fields": [
{
"origin": {
"derivedOrigin": {
"expression": "sales * 100",
"calendarId": "<string>",
"referencedFieldNames": [
"<string>"
]
}
},
"name": "field_name",
"label": "Field Label",
"visible": true,
"format": {
"time": {
"timeZone": "UTC",
"options": {
"hour12": true
}
}
},
"statistics": {
"override": {
"min": 123,
"max": 123,
"distinctValues": [
"<unknown>"
]
},
"cacheEnabled": true,
"refreshable": true,
"cardinality": 123
},
"facetFiltering": {
"enabled": true,
"order": 2
},
"disabledCapabilities": [
"<string>"
],
"fieldMetadata": {},
"rawFormatSupportTimeGroup": true,
"fieldName": "<string>",
"originalFieldName": "<string>"
}
],
"customMetrics": [
{
"expression": "SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate",
"name": "sum_of_sales",
"label": "Sum of Sales",
"visible": true,
"timeFormat": {
"timeZone": "UTC",
"options": {
"hour12": true
}
}
}
],
"globalSettings": {
"textSearchEnabled": true,
"timebar": {
"enabled": true,
"from": "<string>",
"to": "<string>",
"calendarId": "<string>",
"timeField": "<string>",
"sharpening": {
"enabled": true,
"maxQueries": 123
},
"player": {
"enabled": true,
"live": {
"delay": 123,
"refreshRate": 123
}
}
},
"tileProvider": {
"name": "<string>",
"apiKey": "<string>",
"url": "<string>",
"mapBoxStyleId": "<string>"
},
"defaultVisualFilters": [
{
"sourceId": "<string>",
"path": "<string>",
"form": "<string>",
"value": "<unknown>",
"custom": {},
"label": "<string>"
}
],
"allowedCalendarIds": [
"<string>"
]
},
"cacheSettings": {
"dataCache": {
"enabled": true,
"evictionStrategy": {
"ttl": 123
}
},
"statisticsCache": {
"enabled": true,
"evictionStrategy": {
"ttl": 123
}
}
},
"uniqueKey": [
"<string>"
],
"enabledSourceVisualTypes": [
{
"visualTypeId": "<string>",
"name": "<string>",
"type": "<string>",
"enabled": true,
"restriction": {
"value": "<unknown>",
"custom": {},
"label": "<string>",
"path": "<string>"
}
}
]
}
]
}
'import requests
url = "http://10.2.4.166:8080/composer/api/sources/import"
payload = {
"version": "<string>",
"importSettings": {
"objectClassLevel": {},
"objectLevel": {
"visuals": {},
"connections": {},
"sources": {},
"dashboards": {}
},
"warningTags": ["<string>"]
},
"connections": [
{
"name": "<string>",
"type": "<string>",
"subStorageType": "<string>",
"id": "<string>",
"accountId": "<string>",
"creatingUserName": "<string>",
"disabled": True,
"connectionTypeId": "<string>",
"allParameters": [
{
"key": "<string>",
"value": "<string>",
"isSystemAccess": True,
"systemAccess": True
}
],
"folderId": 1111
}
],
"sources": [
{
"fields": [
{
"origin": { "derivedOrigin": {
"expression": "sales * 100",
"calendarId": "<string>",
"referencedFieldNames": ["<string>"]
} },
"name": "field_name",
"label": "Field Label",
"visible": True,
"format": { "time": {
"timeZone": "UTC",
"options": { "hour12": True }
} },
"statistics": {
"override": {
"min": 123,
"max": 123,
"distinctValues": ["<unknown>"]
},
"cacheEnabled": True,
"refreshable": True,
"cardinality": 123
},
"facetFiltering": {
"enabled": True,
"order": 2
},
"disabledCapabilities": ["<string>"],
"fieldMetadata": {},
"rawFormatSupportTimeGroup": True,
"fieldName": "<string>",
"originalFieldName": "<string>"
}
],
"customMetrics": [
{
"expression": "SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate",
"name": "sum_of_sales",
"label": "Sum of Sales",
"visible": True,
"timeFormat": {
"timeZone": "UTC",
"options": { "hour12": True }
}
}
],
"globalSettings": {
"textSearchEnabled": True,
"timebar": {
"enabled": True,
"from": "<string>",
"to": "<string>",
"calendarId": "<string>",
"timeField": "<string>",
"sharpening": {
"enabled": True,
"maxQueries": 123
},
"player": {
"enabled": True,
"live": {
"delay": 123,
"refreshRate": 123
}
}
},
"tileProvider": {
"name": "<string>",
"apiKey": "<string>",
"url": "<string>",
"mapBoxStyleId": "<string>"
},
"defaultVisualFilters": [
{
"sourceId": "<string>",
"path": "<string>",
"form": "<string>",
"value": "<unknown>",
"custom": {},
"label": "<string>"
}
],
"allowedCalendarIds": ["<string>"]
},
"cacheSettings": {
"dataCache": {
"enabled": True,
"evictionStrategy": { "ttl": 123 }
},
"statisticsCache": {
"enabled": True,
"evictionStrategy": { "ttl": 123 }
}
},
"uniqueKey": ["<string>"],
"enabledSourceVisualTypes": [
{
"visualTypeId": "<string>",
"name": "<string>",
"type": "<string>",
"enabled": True,
"restriction": {
"value": "<unknown>",
"custom": {},
"label": "<string>",
"path": "<string>"
}
}
]
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/vnd.composer.v3+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/vnd.composer.v3+json'
},
body: JSON.stringify({
version: '<string>',
importSettings: {
objectClassLevel: {},
objectLevel: {visuals: {}, connections: {}, sources: {}, dashboards: {}},
warningTags: ['<string>']
},
connections: [
{
name: '<string>',
type: '<string>',
subStorageType: '<string>',
id: '<string>',
accountId: '<string>',
creatingUserName: '<string>',
disabled: true,
connectionTypeId: '<string>',
allParameters: [{key: '<string>', value: '<string>', isSystemAccess: true, systemAccess: true}],
folderId: 1111
}
],
sources: [
{
fields: [
{
origin: {
derivedOrigin: {
expression: 'sales * 100',
calendarId: '<string>',
referencedFieldNames: ['<string>']
}
},
name: 'field_name',
label: 'Field Label',
visible: true,
format: {time: {timeZone: 'UTC', options: {hour12: true}}},
statistics: {
override: {min: 123, max: 123, distinctValues: ['<unknown>']},
cacheEnabled: true,
refreshable: true,
cardinality: 123
},
facetFiltering: {enabled: true, order: 2},
disabledCapabilities: ['<string>'],
fieldMetadata: {},
rawFormatSupportTimeGroup: true,
fieldName: '<string>',
originalFieldName: '<string>'
}
],
customMetrics: [
{
expression: 'SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate',
name: 'sum_of_sales',
label: 'Sum of Sales',
visible: true,
timeFormat: {timeZone: 'UTC', options: {hour12: true}}
}
],
globalSettings: {
textSearchEnabled: true,
timebar: {
enabled: true,
from: '<string>',
to: '<string>',
calendarId: '<string>',
timeField: '<string>',
sharpening: {enabled: true, maxQueries: 123},
player: {enabled: true, live: {delay: 123, refreshRate: 123}}
},
tileProvider: {
name: '<string>',
apiKey: '<string>',
url: '<string>',
mapBoxStyleId: '<string>'
},
defaultVisualFilters: [
{
sourceId: '<string>',
path: '<string>',
form: '<string>',
value: '<unknown>',
custom: {},
label: '<string>'
}
],
allowedCalendarIds: ['<string>']
},
cacheSettings: {
dataCache: {enabled: true, evictionStrategy: {ttl: 123}},
statisticsCache: {enabled: true, evictionStrategy: {ttl: 123}}
},
uniqueKey: ['<string>'],
enabledSourceVisualTypes: [
{
visualTypeId: '<string>',
name: '<string>',
type: '<string>',
enabled: true,
restriction: {value: '<unknown>', custom: {}, label: '<string>', path: '<string>'}
}
]
}
]
})
};
fetch('http://10.2.4.166:8080/composer/api/sources/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/sources/import",
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([
'version' => '<string>',
'importSettings' => [
'objectClassLevel' => [
],
'objectLevel' => [
'visuals' => [
],
'connections' => [
],
'sources' => [
],
'dashboards' => [
]
],
'warningTags' => [
'<string>'
]
],
'connections' => [
[
'name' => '<string>',
'type' => '<string>',
'subStorageType' => '<string>',
'id' => '<string>',
'accountId' => '<string>',
'creatingUserName' => '<string>',
'disabled' => true,
'connectionTypeId' => '<string>',
'allParameters' => [
[
'key' => '<string>',
'value' => '<string>',
'isSystemAccess' => true,
'systemAccess' => true
]
],
'folderId' => 1111
]
],
'sources' => [
[
'fields' => [
[
'origin' => [
'derivedOrigin' => [
'expression' => 'sales * 100',
'calendarId' => '<string>',
'referencedFieldNames' => [
'<string>'
]
]
],
'name' => 'field_name',
'label' => 'Field Label',
'visible' => true,
'format' => [
'time' => [
'timeZone' => 'UTC',
'options' => [
'hour12' => true
]
]
],
'statistics' => [
'override' => [
'min' => 123,
'max' => 123,
'distinctValues' => [
'<unknown>'
]
],
'cacheEnabled' => true,
'refreshable' => true,
'cardinality' => 123
],
'facetFiltering' => [
'enabled' => true,
'order' => 2
],
'disabledCapabilities' => [
'<string>'
],
'fieldMetadata' => [
],
'rawFormatSupportTimeGroup' => true,
'fieldName' => '<string>',
'originalFieldName' => '<string>'
]
],
'customMetrics' => [
[
'expression' => 'SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate',
'name' => 'sum_of_sales',
'label' => 'Sum of Sales',
'visible' => true,
'timeFormat' => [
'timeZone' => 'UTC',
'options' => [
'hour12' => true
]
]
]
],
'globalSettings' => [
'textSearchEnabled' => true,
'timebar' => [
'enabled' => true,
'from' => '<string>',
'to' => '<string>',
'calendarId' => '<string>',
'timeField' => '<string>',
'sharpening' => [
'enabled' => true,
'maxQueries' => 123
],
'player' => [
'enabled' => true,
'live' => [
'delay' => 123,
'refreshRate' => 123
]
]
],
'tileProvider' => [
'name' => '<string>',
'apiKey' => '<string>',
'url' => '<string>',
'mapBoxStyleId' => '<string>'
],
'defaultVisualFilters' => [
[
'sourceId' => '<string>',
'path' => '<string>',
'form' => '<string>',
'value' => '<unknown>',
'custom' => [
],
'label' => '<string>'
]
],
'allowedCalendarIds' => [
'<string>'
]
],
'cacheSettings' => [
'dataCache' => [
'enabled' => true,
'evictionStrategy' => [
'ttl' => 123
]
],
'statisticsCache' => [
'enabled' => true,
'evictionStrategy' => [
'ttl' => 123
]
]
],
'uniqueKey' => [
'<string>'
],
'enabledSourceVisualTypes' => [
[
'visualTypeId' => '<string>',
'name' => '<string>',
'type' => '<string>',
'enabled' => true,
'restriction' => [
'value' => '<unknown>',
'custom' => [
],
'label' => '<string>',
'path' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/vnd.composer.v3+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://10.2.4.166:8080/composer/api/sources/import"
payload := strings.NewReader("{\n \"version\": \"<string>\",\n \"importSettings\": {\n \"objectClassLevel\": {},\n \"objectLevel\": {\n \"visuals\": {},\n \"connections\": {},\n \"sources\": {},\n \"dashboards\": {}\n },\n \"warningTags\": [\n \"<string>\"\n ]\n },\n \"connections\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"subStorageType\": \"<string>\",\n \"id\": \"<string>\",\n \"accountId\": \"<string>\",\n \"creatingUserName\": \"<string>\",\n \"disabled\": true,\n \"connectionTypeId\": \"<string>\",\n \"allParameters\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"isSystemAccess\": true,\n \"systemAccess\": true\n }\n ],\n \"folderId\": 1111\n }\n ],\n \"sources\": [\n {\n \"fields\": [\n {\n \"origin\": {\n \"derivedOrigin\": {\n \"expression\": \"sales * 100\",\n \"calendarId\": \"<string>\",\n \"referencedFieldNames\": [\n \"<string>\"\n ]\n }\n },\n \"name\": \"field_name\",\n \"label\": \"Field Label\",\n \"visible\": true,\n \"format\": {\n \"time\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n },\n \"statistics\": {\n \"override\": {\n \"min\": 123,\n \"max\": 123,\n \"distinctValues\": [\n \"<unknown>\"\n ]\n },\n \"cacheEnabled\": true,\n \"refreshable\": true,\n \"cardinality\": 123\n },\n \"facetFiltering\": {\n \"enabled\": true,\n \"order\": 2\n },\n \"disabledCapabilities\": [\n \"<string>\"\n ],\n \"fieldMetadata\": {},\n \"rawFormatSupportTimeGroup\": true,\n \"fieldName\": \"<string>\",\n \"originalFieldName\": \"<string>\"\n }\n ],\n \"customMetrics\": [\n {\n \"expression\": \"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate\",\n \"name\": \"sum_of_sales\",\n \"label\": \"Sum of Sales\",\n \"visible\": true,\n \"timeFormat\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n }\n ],\n \"globalSettings\": {\n \"textSearchEnabled\": true,\n \"timebar\": {\n \"enabled\": true,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"timeField\": \"<string>\",\n \"sharpening\": {\n \"enabled\": true,\n \"maxQueries\": 123\n },\n \"player\": {\n \"enabled\": true,\n \"live\": {\n \"delay\": 123,\n \"refreshRate\": 123\n }\n }\n },\n \"tileProvider\": {\n \"name\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"url\": \"<string>\",\n \"mapBoxStyleId\": \"<string>\"\n },\n \"defaultVisualFilters\": [\n {\n \"sourceId\": \"<string>\",\n \"path\": \"<string>\",\n \"form\": \"<string>\",\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\"\n }\n ],\n \"allowedCalendarIds\": [\n \"<string>\"\n ]\n },\n \"cacheSettings\": {\n \"dataCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n },\n \"statisticsCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n }\n },\n \"uniqueKey\": [\n \"<string>\"\n ],\n \"enabledSourceVisualTypes\": [\n {\n \"visualTypeId\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"enabled\": true,\n \"restriction\": {\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\",\n \"path\": \"<string>\"\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/vnd.composer.v3+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://10.2.4.166:8080/composer/api/sources/import")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/vnd.composer.v3+json")
.body("{\n \"version\": \"<string>\",\n \"importSettings\": {\n \"objectClassLevel\": {},\n \"objectLevel\": {\n \"visuals\": {},\n \"connections\": {},\n \"sources\": {},\n \"dashboards\": {}\n },\n \"warningTags\": [\n \"<string>\"\n ]\n },\n \"connections\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"subStorageType\": \"<string>\",\n \"id\": \"<string>\",\n \"accountId\": \"<string>\",\n \"creatingUserName\": \"<string>\",\n \"disabled\": true,\n \"connectionTypeId\": \"<string>\",\n \"allParameters\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"isSystemAccess\": true,\n \"systemAccess\": true\n }\n ],\n \"folderId\": 1111\n }\n ],\n \"sources\": [\n {\n \"fields\": [\n {\n \"origin\": {\n \"derivedOrigin\": {\n \"expression\": \"sales * 100\",\n \"calendarId\": \"<string>\",\n \"referencedFieldNames\": [\n \"<string>\"\n ]\n }\n },\n \"name\": \"field_name\",\n \"label\": \"Field Label\",\n \"visible\": true,\n \"format\": {\n \"time\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n },\n \"statistics\": {\n \"override\": {\n \"min\": 123,\n \"max\": 123,\n \"distinctValues\": [\n \"<unknown>\"\n ]\n },\n \"cacheEnabled\": true,\n \"refreshable\": true,\n \"cardinality\": 123\n },\n \"facetFiltering\": {\n \"enabled\": true,\n \"order\": 2\n },\n \"disabledCapabilities\": [\n \"<string>\"\n ],\n \"fieldMetadata\": {},\n \"rawFormatSupportTimeGroup\": true,\n \"fieldName\": \"<string>\",\n \"originalFieldName\": \"<string>\"\n }\n ],\n \"customMetrics\": [\n {\n \"expression\": \"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate\",\n \"name\": \"sum_of_sales\",\n \"label\": \"Sum of Sales\",\n \"visible\": true,\n \"timeFormat\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n }\n ],\n \"globalSettings\": {\n \"textSearchEnabled\": true,\n \"timebar\": {\n \"enabled\": true,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"timeField\": \"<string>\",\n \"sharpening\": {\n \"enabled\": true,\n \"maxQueries\": 123\n },\n \"player\": {\n \"enabled\": true,\n \"live\": {\n \"delay\": 123,\n \"refreshRate\": 123\n }\n }\n },\n \"tileProvider\": {\n \"name\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"url\": \"<string>\",\n \"mapBoxStyleId\": \"<string>\"\n },\n \"defaultVisualFilters\": [\n {\n \"sourceId\": \"<string>\",\n \"path\": \"<string>\",\n \"form\": \"<string>\",\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\"\n }\n ],\n \"allowedCalendarIds\": [\n \"<string>\"\n ]\n },\n \"cacheSettings\": {\n \"dataCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n },\n \"statisticsCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n }\n },\n \"uniqueKey\": [\n \"<string>\"\n ],\n \"enabledSourceVisualTypes\": [\n {\n \"visualTypeId\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"enabled\": true,\n \"restriction\": {\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\",\n \"path\": \"<string>\"\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/sources/import")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/vnd.composer.v3+json'
request.body = "{\n \"version\": \"<string>\",\n \"importSettings\": {\n \"objectClassLevel\": {},\n \"objectLevel\": {\n \"visuals\": {},\n \"connections\": {},\n \"sources\": {},\n \"dashboards\": {}\n },\n \"warningTags\": [\n \"<string>\"\n ]\n },\n \"connections\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"subStorageType\": \"<string>\",\n \"id\": \"<string>\",\n \"accountId\": \"<string>\",\n \"creatingUserName\": \"<string>\",\n \"disabled\": true,\n \"connectionTypeId\": \"<string>\",\n \"allParameters\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"isSystemAccess\": true,\n \"systemAccess\": true\n }\n ],\n \"folderId\": 1111\n }\n ],\n \"sources\": [\n {\n \"fields\": [\n {\n \"origin\": {\n \"derivedOrigin\": {\n \"expression\": \"sales * 100\",\n \"calendarId\": \"<string>\",\n \"referencedFieldNames\": [\n \"<string>\"\n ]\n }\n },\n \"name\": \"field_name\",\n \"label\": \"Field Label\",\n \"visible\": true,\n \"format\": {\n \"time\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n },\n \"statistics\": {\n \"override\": {\n \"min\": 123,\n \"max\": 123,\n \"distinctValues\": [\n \"<unknown>\"\n ]\n },\n \"cacheEnabled\": true,\n \"refreshable\": true,\n \"cardinality\": 123\n },\n \"facetFiltering\": {\n \"enabled\": true,\n \"order\": 2\n },\n \"disabledCapabilities\": [\n \"<string>\"\n ],\n \"fieldMetadata\": {},\n \"rawFormatSupportTimeGroup\": true,\n \"fieldName\": \"<string>\",\n \"originalFieldName\": \"<string>\"\n }\n ],\n \"customMetrics\": [\n {\n \"expression\": \"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate\",\n \"name\": \"sum_of_sales\",\n \"label\": \"Sum of Sales\",\n \"visible\": true,\n \"timeFormat\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n }\n ],\n \"globalSettings\": {\n \"textSearchEnabled\": true,\n \"timebar\": {\n \"enabled\": true,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"timeField\": \"<string>\",\n \"sharpening\": {\n \"enabled\": true,\n \"maxQueries\": 123\n },\n \"player\": {\n \"enabled\": true,\n \"live\": {\n \"delay\": 123,\n \"refreshRate\": 123\n }\n }\n },\n \"tileProvider\": {\n \"name\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"url\": \"<string>\",\n \"mapBoxStyleId\": \"<string>\"\n },\n \"defaultVisualFilters\": [\n {\n \"sourceId\": \"<string>\",\n \"path\": \"<string>\",\n \"form\": \"<string>\",\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\"\n }\n ],\n \"allowedCalendarIds\": [\n \"<string>\"\n ]\n },\n \"cacheSettings\": {\n \"dataCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n },\n \"statisticsCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n }\n },\n \"uniqueKey\": [\n \"<string>\"\n ],\n \"enabledSourceVisualTypes\": [\n {\n \"visualTypeId\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"enabled\": true,\n \"restriction\": {\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\",\n \"path\": \"<string>\"\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"dashboards": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"visuals": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"sources": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"uploads": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"visualTypes": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"connections": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"snippets": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"calendars": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}Import sources
curl --request POST \
--url http://10.2.4.166:8080/composer/api/sources/import \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/vnd.composer.v3+json' \
--data '
{
"version": "<string>",
"importSettings": {
"objectClassLevel": {},
"objectLevel": {
"visuals": {},
"connections": {},
"sources": {},
"dashboards": {}
},
"warningTags": [
"<string>"
]
},
"connections": [
{
"name": "<string>",
"type": "<string>",
"subStorageType": "<string>",
"id": "<string>",
"accountId": "<string>",
"creatingUserName": "<string>",
"disabled": true,
"connectionTypeId": "<string>",
"allParameters": [
{
"key": "<string>",
"value": "<string>",
"isSystemAccess": true,
"systemAccess": true
}
],
"folderId": 1111
}
],
"sources": [
{
"fields": [
{
"origin": {
"derivedOrigin": {
"expression": "sales * 100",
"calendarId": "<string>",
"referencedFieldNames": [
"<string>"
]
}
},
"name": "field_name",
"label": "Field Label",
"visible": true,
"format": {
"time": {
"timeZone": "UTC",
"options": {
"hour12": true
}
}
},
"statistics": {
"override": {
"min": 123,
"max": 123,
"distinctValues": [
"<unknown>"
]
},
"cacheEnabled": true,
"refreshable": true,
"cardinality": 123
},
"facetFiltering": {
"enabled": true,
"order": 2
},
"disabledCapabilities": [
"<string>"
],
"fieldMetadata": {},
"rawFormatSupportTimeGroup": true,
"fieldName": "<string>",
"originalFieldName": "<string>"
}
],
"customMetrics": [
{
"expression": "SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate",
"name": "sum_of_sales",
"label": "Sum of Sales",
"visible": true,
"timeFormat": {
"timeZone": "UTC",
"options": {
"hour12": true
}
}
}
],
"globalSettings": {
"textSearchEnabled": true,
"timebar": {
"enabled": true,
"from": "<string>",
"to": "<string>",
"calendarId": "<string>",
"timeField": "<string>",
"sharpening": {
"enabled": true,
"maxQueries": 123
},
"player": {
"enabled": true,
"live": {
"delay": 123,
"refreshRate": 123
}
}
},
"tileProvider": {
"name": "<string>",
"apiKey": "<string>",
"url": "<string>",
"mapBoxStyleId": "<string>"
},
"defaultVisualFilters": [
{
"sourceId": "<string>",
"path": "<string>",
"form": "<string>",
"value": "<unknown>",
"custom": {},
"label": "<string>"
}
],
"allowedCalendarIds": [
"<string>"
]
},
"cacheSettings": {
"dataCache": {
"enabled": true,
"evictionStrategy": {
"ttl": 123
}
},
"statisticsCache": {
"enabled": true,
"evictionStrategy": {
"ttl": 123
}
}
},
"uniqueKey": [
"<string>"
],
"enabledSourceVisualTypes": [
{
"visualTypeId": "<string>",
"name": "<string>",
"type": "<string>",
"enabled": true,
"restriction": {
"value": "<unknown>",
"custom": {},
"label": "<string>",
"path": "<string>"
}
}
]
}
]
}
'import requests
url = "http://10.2.4.166:8080/composer/api/sources/import"
payload = {
"version": "<string>",
"importSettings": {
"objectClassLevel": {},
"objectLevel": {
"visuals": {},
"connections": {},
"sources": {},
"dashboards": {}
},
"warningTags": ["<string>"]
},
"connections": [
{
"name": "<string>",
"type": "<string>",
"subStorageType": "<string>",
"id": "<string>",
"accountId": "<string>",
"creatingUserName": "<string>",
"disabled": True,
"connectionTypeId": "<string>",
"allParameters": [
{
"key": "<string>",
"value": "<string>",
"isSystemAccess": True,
"systemAccess": True
}
],
"folderId": 1111
}
],
"sources": [
{
"fields": [
{
"origin": { "derivedOrigin": {
"expression": "sales * 100",
"calendarId": "<string>",
"referencedFieldNames": ["<string>"]
} },
"name": "field_name",
"label": "Field Label",
"visible": True,
"format": { "time": {
"timeZone": "UTC",
"options": { "hour12": True }
} },
"statistics": {
"override": {
"min": 123,
"max": 123,
"distinctValues": ["<unknown>"]
},
"cacheEnabled": True,
"refreshable": True,
"cardinality": 123
},
"facetFiltering": {
"enabled": True,
"order": 2
},
"disabledCapabilities": ["<string>"],
"fieldMetadata": {},
"rawFormatSupportTimeGroup": True,
"fieldName": "<string>",
"originalFieldName": "<string>"
}
],
"customMetrics": [
{
"expression": "SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate",
"name": "sum_of_sales",
"label": "Sum of Sales",
"visible": True,
"timeFormat": {
"timeZone": "UTC",
"options": { "hour12": True }
}
}
],
"globalSettings": {
"textSearchEnabled": True,
"timebar": {
"enabled": True,
"from": "<string>",
"to": "<string>",
"calendarId": "<string>",
"timeField": "<string>",
"sharpening": {
"enabled": True,
"maxQueries": 123
},
"player": {
"enabled": True,
"live": {
"delay": 123,
"refreshRate": 123
}
}
},
"tileProvider": {
"name": "<string>",
"apiKey": "<string>",
"url": "<string>",
"mapBoxStyleId": "<string>"
},
"defaultVisualFilters": [
{
"sourceId": "<string>",
"path": "<string>",
"form": "<string>",
"value": "<unknown>",
"custom": {},
"label": "<string>"
}
],
"allowedCalendarIds": ["<string>"]
},
"cacheSettings": {
"dataCache": {
"enabled": True,
"evictionStrategy": { "ttl": 123 }
},
"statisticsCache": {
"enabled": True,
"evictionStrategy": { "ttl": 123 }
}
},
"uniqueKey": ["<string>"],
"enabledSourceVisualTypes": [
{
"visualTypeId": "<string>",
"name": "<string>",
"type": "<string>",
"enabled": True,
"restriction": {
"value": "<unknown>",
"custom": {},
"label": "<string>",
"path": "<string>"
}
}
]
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/vnd.composer.v3+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/vnd.composer.v3+json'
},
body: JSON.stringify({
version: '<string>',
importSettings: {
objectClassLevel: {},
objectLevel: {visuals: {}, connections: {}, sources: {}, dashboards: {}},
warningTags: ['<string>']
},
connections: [
{
name: '<string>',
type: '<string>',
subStorageType: '<string>',
id: '<string>',
accountId: '<string>',
creatingUserName: '<string>',
disabled: true,
connectionTypeId: '<string>',
allParameters: [{key: '<string>', value: '<string>', isSystemAccess: true, systemAccess: true}],
folderId: 1111
}
],
sources: [
{
fields: [
{
origin: {
derivedOrigin: {
expression: 'sales * 100',
calendarId: '<string>',
referencedFieldNames: ['<string>']
}
},
name: 'field_name',
label: 'Field Label',
visible: true,
format: {time: {timeZone: 'UTC', options: {hour12: true}}},
statistics: {
override: {min: 123, max: 123, distinctValues: ['<unknown>']},
cacheEnabled: true,
refreshable: true,
cardinality: 123
},
facetFiltering: {enabled: true, order: 2},
disabledCapabilities: ['<string>'],
fieldMetadata: {},
rawFormatSupportTimeGroup: true,
fieldName: '<string>',
originalFieldName: '<string>'
}
],
customMetrics: [
{
expression: 'SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate',
name: 'sum_of_sales',
label: 'Sum of Sales',
visible: true,
timeFormat: {timeZone: 'UTC', options: {hour12: true}}
}
],
globalSettings: {
textSearchEnabled: true,
timebar: {
enabled: true,
from: '<string>',
to: '<string>',
calendarId: '<string>',
timeField: '<string>',
sharpening: {enabled: true, maxQueries: 123},
player: {enabled: true, live: {delay: 123, refreshRate: 123}}
},
tileProvider: {
name: '<string>',
apiKey: '<string>',
url: '<string>',
mapBoxStyleId: '<string>'
},
defaultVisualFilters: [
{
sourceId: '<string>',
path: '<string>',
form: '<string>',
value: '<unknown>',
custom: {},
label: '<string>'
}
],
allowedCalendarIds: ['<string>']
},
cacheSettings: {
dataCache: {enabled: true, evictionStrategy: {ttl: 123}},
statisticsCache: {enabled: true, evictionStrategy: {ttl: 123}}
},
uniqueKey: ['<string>'],
enabledSourceVisualTypes: [
{
visualTypeId: '<string>',
name: '<string>',
type: '<string>',
enabled: true,
restriction: {value: '<unknown>', custom: {}, label: '<string>', path: '<string>'}
}
]
}
]
})
};
fetch('http://10.2.4.166:8080/composer/api/sources/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/sources/import",
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([
'version' => '<string>',
'importSettings' => [
'objectClassLevel' => [
],
'objectLevel' => [
'visuals' => [
],
'connections' => [
],
'sources' => [
],
'dashboards' => [
]
],
'warningTags' => [
'<string>'
]
],
'connections' => [
[
'name' => '<string>',
'type' => '<string>',
'subStorageType' => '<string>',
'id' => '<string>',
'accountId' => '<string>',
'creatingUserName' => '<string>',
'disabled' => true,
'connectionTypeId' => '<string>',
'allParameters' => [
[
'key' => '<string>',
'value' => '<string>',
'isSystemAccess' => true,
'systemAccess' => true
]
],
'folderId' => 1111
]
],
'sources' => [
[
'fields' => [
[
'origin' => [
'derivedOrigin' => [
'expression' => 'sales * 100',
'calendarId' => '<string>',
'referencedFieldNames' => [
'<string>'
]
]
],
'name' => 'field_name',
'label' => 'Field Label',
'visible' => true,
'format' => [
'time' => [
'timeZone' => 'UTC',
'options' => [
'hour12' => true
]
]
],
'statistics' => [
'override' => [
'min' => 123,
'max' => 123,
'distinctValues' => [
'<unknown>'
]
],
'cacheEnabled' => true,
'refreshable' => true,
'cardinality' => 123
],
'facetFiltering' => [
'enabled' => true,
'order' => 2
],
'disabledCapabilities' => [
'<string>'
],
'fieldMetadata' => [
],
'rawFormatSupportTimeGroup' => true,
'fieldName' => '<string>',
'originalFieldName' => '<string>'
]
],
'customMetrics' => [
[
'expression' => 'SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate',
'name' => 'sum_of_sales',
'label' => 'Sum of Sales',
'visible' => true,
'timeFormat' => [
'timeZone' => 'UTC',
'options' => [
'hour12' => true
]
]
]
],
'globalSettings' => [
'textSearchEnabled' => true,
'timebar' => [
'enabled' => true,
'from' => '<string>',
'to' => '<string>',
'calendarId' => '<string>',
'timeField' => '<string>',
'sharpening' => [
'enabled' => true,
'maxQueries' => 123
],
'player' => [
'enabled' => true,
'live' => [
'delay' => 123,
'refreshRate' => 123
]
]
],
'tileProvider' => [
'name' => '<string>',
'apiKey' => '<string>',
'url' => '<string>',
'mapBoxStyleId' => '<string>'
],
'defaultVisualFilters' => [
[
'sourceId' => '<string>',
'path' => '<string>',
'form' => '<string>',
'value' => '<unknown>',
'custom' => [
],
'label' => '<string>'
]
],
'allowedCalendarIds' => [
'<string>'
]
],
'cacheSettings' => [
'dataCache' => [
'enabled' => true,
'evictionStrategy' => [
'ttl' => 123
]
],
'statisticsCache' => [
'enabled' => true,
'evictionStrategy' => [
'ttl' => 123
]
]
],
'uniqueKey' => [
'<string>'
],
'enabledSourceVisualTypes' => [
[
'visualTypeId' => '<string>',
'name' => '<string>',
'type' => '<string>',
'enabled' => true,
'restriction' => [
'value' => '<unknown>',
'custom' => [
],
'label' => '<string>',
'path' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/vnd.composer.v3+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://10.2.4.166:8080/composer/api/sources/import"
payload := strings.NewReader("{\n \"version\": \"<string>\",\n \"importSettings\": {\n \"objectClassLevel\": {},\n \"objectLevel\": {\n \"visuals\": {},\n \"connections\": {},\n \"sources\": {},\n \"dashboards\": {}\n },\n \"warningTags\": [\n \"<string>\"\n ]\n },\n \"connections\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"subStorageType\": \"<string>\",\n \"id\": \"<string>\",\n \"accountId\": \"<string>\",\n \"creatingUserName\": \"<string>\",\n \"disabled\": true,\n \"connectionTypeId\": \"<string>\",\n \"allParameters\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"isSystemAccess\": true,\n \"systemAccess\": true\n }\n ],\n \"folderId\": 1111\n }\n ],\n \"sources\": [\n {\n \"fields\": [\n {\n \"origin\": {\n \"derivedOrigin\": {\n \"expression\": \"sales * 100\",\n \"calendarId\": \"<string>\",\n \"referencedFieldNames\": [\n \"<string>\"\n ]\n }\n },\n \"name\": \"field_name\",\n \"label\": \"Field Label\",\n \"visible\": true,\n \"format\": {\n \"time\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n },\n \"statistics\": {\n \"override\": {\n \"min\": 123,\n \"max\": 123,\n \"distinctValues\": [\n \"<unknown>\"\n ]\n },\n \"cacheEnabled\": true,\n \"refreshable\": true,\n \"cardinality\": 123\n },\n \"facetFiltering\": {\n \"enabled\": true,\n \"order\": 2\n },\n \"disabledCapabilities\": [\n \"<string>\"\n ],\n \"fieldMetadata\": {},\n \"rawFormatSupportTimeGroup\": true,\n \"fieldName\": \"<string>\",\n \"originalFieldName\": \"<string>\"\n }\n ],\n \"customMetrics\": [\n {\n \"expression\": \"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate\",\n \"name\": \"sum_of_sales\",\n \"label\": \"Sum of Sales\",\n \"visible\": true,\n \"timeFormat\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n }\n ],\n \"globalSettings\": {\n \"textSearchEnabled\": true,\n \"timebar\": {\n \"enabled\": true,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"timeField\": \"<string>\",\n \"sharpening\": {\n \"enabled\": true,\n \"maxQueries\": 123\n },\n \"player\": {\n \"enabled\": true,\n \"live\": {\n \"delay\": 123,\n \"refreshRate\": 123\n }\n }\n },\n \"tileProvider\": {\n \"name\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"url\": \"<string>\",\n \"mapBoxStyleId\": \"<string>\"\n },\n \"defaultVisualFilters\": [\n {\n \"sourceId\": \"<string>\",\n \"path\": \"<string>\",\n \"form\": \"<string>\",\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\"\n }\n ],\n \"allowedCalendarIds\": [\n \"<string>\"\n ]\n },\n \"cacheSettings\": {\n \"dataCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n },\n \"statisticsCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n }\n },\n \"uniqueKey\": [\n \"<string>\"\n ],\n \"enabledSourceVisualTypes\": [\n {\n \"visualTypeId\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"enabled\": true,\n \"restriction\": {\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\",\n \"path\": \"<string>\"\n }\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/vnd.composer.v3+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://10.2.4.166:8080/composer/api/sources/import")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/vnd.composer.v3+json")
.body("{\n \"version\": \"<string>\",\n \"importSettings\": {\n \"objectClassLevel\": {},\n \"objectLevel\": {\n \"visuals\": {},\n \"connections\": {},\n \"sources\": {},\n \"dashboards\": {}\n },\n \"warningTags\": [\n \"<string>\"\n ]\n },\n \"connections\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"subStorageType\": \"<string>\",\n \"id\": \"<string>\",\n \"accountId\": \"<string>\",\n \"creatingUserName\": \"<string>\",\n \"disabled\": true,\n \"connectionTypeId\": \"<string>\",\n \"allParameters\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"isSystemAccess\": true,\n \"systemAccess\": true\n }\n ],\n \"folderId\": 1111\n }\n ],\n \"sources\": [\n {\n \"fields\": [\n {\n \"origin\": {\n \"derivedOrigin\": {\n \"expression\": \"sales * 100\",\n \"calendarId\": \"<string>\",\n \"referencedFieldNames\": [\n \"<string>\"\n ]\n }\n },\n \"name\": \"field_name\",\n \"label\": \"Field Label\",\n \"visible\": true,\n \"format\": {\n \"time\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n },\n \"statistics\": {\n \"override\": {\n \"min\": 123,\n \"max\": 123,\n \"distinctValues\": [\n \"<unknown>\"\n ]\n },\n \"cacheEnabled\": true,\n \"refreshable\": true,\n \"cardinality\": 123\n },\n \"facetFiltering\": {\n \"enabled\": true,\n \"order\": 2\n },\n \"disabledCapabilities\": [\n \"<string>\"\n ],\n \"fieldMetadata\": {},\n \"rawFormatSupportTimeGroup\": true,\n \"fieldName\": \"<string>\",\n \"originalFieldName\": \"<string>\"\n }\n ],\n \"customMetrics\": [\n {\n \"expression\": \"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate\",\n \"name\": \"sum_of_sales\",\n \"label\": \"Sum of Sales\",\n \"visible\": true,\n \"timeFormat\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n }\n ],\n \"globalSettings\": {\n \"textSearchEnabled\": true,\n \"timebar\": {\n \"enabled\": true,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"timeField\": \"<string>\",\n \"sharpening\": {\n \"enabled\": true,\n \"maxQueries\": 123\n },\n \"player\": {\n \"enabled\": true,\n \"live\": {\n \"delay\": 123,\n \"refreshRate\": 123\n }\n }\n },\n \"tileProvider\": {\n \"name\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"url\": \"<string>\",\n \"mapBoxStyleId\": \"<string>\"\n },\n \"defaultVisualFilters\": [\n {\n \"sourceId\": \"<string>\",\n \"path\": \"<string>\",\n \"form\": \"<string>\",\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\"\n }\n ],\n \"allowedCalendarIds\": [\n \"<string>\"\n ]\n },\n \"cacheSettings\": {\n \"dataCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n },\n \"statisticsCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n }\n },\n \"uniqueKey\": [\n \"<string>\"\n ],\n \"enabledSourceVisualTypes\": [\n {\n \"visualTypeId\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"enabled\": true,\n \"restriction\": {\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\",\n \"path\": \"<string>\"\n }\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/sources/import")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/vnd.composer.v3+json'
request.body = "{\n \"version\": \"<string>\",\n \"importSettings\": {\n \"objectClassLevel\": {},\n \"objectLevel\": {\n \"visuals\": {},\n \"connections\": {},\n \"sources\": {},\n \"dashboards\": {}\n },\n \"warningTags\": [\n \"<string>\"\n ]\n },\n \"connections\": [\n {\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"subStorageType\": \"<string>\",\n \"id\": \"<string>\",\n \"accountId\": \"<string>\",\n \"creatingUserName\": \"<string>\",\n \"disabled\": true,\n \"connectionTypeId\": \"<string>\",\n \"allParameters\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"isSystemAccess\": true,\n \"systemAccess\": true\n }\n ],\n \"folderId\": 1111\n }\n ],\n \"sources\": [\n {\n \"fields\": [\n {\n \"origin\": {\n \"derivedOrigin\": {\n \"expression\": \"sales * 100\",\n \"calendarId\": \"<string>\",\n \"referencedFieldNames\": [\n \"<string>\"\n ]\n }\n },\n \"name\": \"field_name\",\n \"label\": \"Field Label\",\n \"visible\": true,\n \"format\": {\n \"time\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n },\n \"statistics\": {\n \"override\": {\n \"min\": 123,\n \"max\": 123,\n \"distinctValues\": [\n \"<unknown>\"\n ]\n },\n \"cacheEnabled\": true,\n \"refreshable\": true,\n \"cardinality\": 123\n },\n \"facetFiltering\": {\n \"enabled\": true,\n \"order\": 2\n },\n \"disabledCapabilities\": [\n \"<string>\"\n ],\n \"fieldMetadata\": {},\n \"rawFormatSupportTimeGroup\": true,\n \"fieldName\": \"<string>\",\n \"originalFieldName\": \"<string>\"\n }\n ],\n \"customMetrics\": [\n {\n \"expression\": \"SUM(sales_in_usd) + SUM(sales_in_uah) * uah_to_usd_exchange_rate\",\n \"name\": \"sum_of_sales\",\n \"label\": \"Sum of Sales\",\n \"visible\": true,\n \"timeFormat\": {\n \"timeZone\": \"UTC\",\n \"options\": {\n \"hour12\": true\n }\n }\n }\n ],\n \"globalSettings\": {\n \"textSearchEnabled\": true,\n \"timebar\": {\n \"enabled\": true,\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"calendarId\": \"<string>\",\n \"timeField\": \"<string>\",\n \"sharpening\": {\n \"enabled\": true,\n \"maxQueries\": 123\n },\n \"player\": {\n \"enabled\": true,\n \"live\": {\n \"delay\": 123,\n \"refreshRate\": 123\n }\n }\n },\n \"tileProvider\": {\n \"name\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"url\": \"<string>\",\n \"mapBoxStyleId\": \"<string>\"\n },\n \"defaultVisualFilters\": [\n {\n \"sourceId\": \"<string>\",\n \"path\": \"<string>\",\n \"form\": \"<string>\",\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\"\n }\n ],\n \"allowedCalendarIds\": [\n \"<string>\"\n ]\n },\n \"cacheSettings\": {\n \"dataCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n },\n \"statisticsCache\": {\n \"enabled\": true,\n \"evictionStrategy\": {\n \"ttl\": 123\n }\n }\n },\n \"uniqueKey\": [\n \"<string>\"\n ],\n \"enabledSourceVisualTypes\": [\n {\n \"visualTypeId\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"enabled\": true,\n \"restriction\": {\n \"value\": \"<unknown>\",\n \"custom\": {},\n \"label\": \"<string>\",\n \"path\": \"<string>\"\n }\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"dashboards": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"visuals": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"sources": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"uploads": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"visualTypes": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"connections": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"snippets": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
],
"calendars": [
{
"id": "<string>",
"name": "<string>",
"status": "CREATED",
"href": "<string>",
"dependencies": [
{
"type": "DASHBOARD",
"id": "<string>"
}
],
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}{
"error": "<string>",
"details": "<string>",
"message": "<string>",
"path": "<string>",
"status": "<string>",
"code": "<string>",
"errorCode": "<string>",
"timestamp": "<string>",
"problems": [
{
"name": "<string>",
"message": "<string>",
"level": "ERROR",
"dependencies": {}
}
]
}Authorizations
HTTP Basic authentication using global administrator credentials (username and password).
Query Parameters
Target Account
The response to this API endpoint may return a validation error with a list of problems. Each problem has a level (ERROR, WARNING). Passing suppressWarnings=true will suppress all warnings and the request will succeed if there were no errors.
Will enable data read permissions for sources imported for all the users in the tenant.
Body
Response
The sources were imported
Defines result of dashboard import
Defines imported dashboards
Show child attributes
Show child attributes
Defines imported visuals
Show child attributes
Show child attributes
Defines imported sources
Show child attributes
Show child attributes
Defines imported uploads
Show child attributes
Show child attributes
Defines imported visual types
Show child attributes
Show child attributes
Defines imported connections
Show child attributes
Show child attributes
Defines imported snippets
Show child attributes
Show child attributes
Defines imported calendars
Show child attributes
Show child attributes
Was this page helpful?