http
POST /api/data/v2/datasources/{datasetId}/schemas HTTP/1.1
Host: {instance}.domo.com
x-domo-authentication: {session_token}
Content-Type: application/json
Accept: application/json
{
"columns": [
{
"name": "name",
"id": "name",
"type": "STRING",
"visible": true,
"order": 0
},
{
"name": "id",
"id": "id",
"type": "LONG",
"visible": true,
"order": 0
},
{
"name": "alertId",
"id": "alertId",
"type": "LONG",
"visible": true,
"order": 0
}
]
}curl --request POST \
--url https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas \
--header 'Content-Type: application/json' \
--header 'x-domo-authentication: <api-key>' \
--data '
{
"columns": [
{
"name": "name",
"id": "name",
"type": "STRING",
"visible": true,
"order": 0
},
{
"name": "id",
"id": "id",
"type": "LONG",
"visible": true,
"order": 0
},
{
"name": "alertId",
"id": "alertId",
"type": "LONG",
"visible": true,
"order": 0
}
]
}
'import requests
url = "https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas"
payload = { "columns": [
{
"name": "name",
"id": "name",
"type": "STRING",
"visible": True,
"order": 0
},
{
"name": "id",
"id": "id",
"type": "LONG",
"visible": True,
"order": 0
},
{
"name": "alertId",
"id": "alertId",
"type": "LONG",
"visible": True,
"order": 0
}
] }
headers = {
"x-domo-authentication": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-domo-authentication': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
columns: [
{name: 'name', id: 'name', type: 'STRING', visible: true, order: 0},
{name: 'id', id: 'id', type: 'LONG', visible: true, order: 0},
{name: 'alertId', id: 'alertId', type: 'LONG', visible: true, order: 0}
]
})
};
fetch('https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas', 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://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas",
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([
'columns' => [
[
'name' => 'name',
'id' => 'name',
'type' => 'STRING',
'visible' => true,
'order' => 0
],
[
'name' => 'id',
'id' => 'id',
'type' => 'LONG',
'visible' => true,
'order' => 0
],
[
'name' => 'alertId',
'id' => 'alertId',
'type' => 'LONG',
'visible' => true,
'order' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-domo-authentication: <api-key>"
],
]);
$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://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas"
payload := strings.NewReader("{\n \"columns\": [\n {\n \"name\": \"name\",\n \"id\": \"name\",\n \"type\": \"STRING\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"id\",\n \"id\": \"id\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"alertId\",\n \"id\": \"alertId\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-domo-authentication", "<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("https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas")
.header("x-domo-authentication", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": [\n {\n \"name\": \"name\",\n \"id\": \"name\",\n \"type\": \"STRING\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"id\",\n \"id\": \"id\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"alertId\",\n \"id\": \"alertId\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-domo-authentication"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": [\n {\n \"name\": \"name\",\n \"id\": \"name\",\n \"type\": \"STRING\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"id\",\n \"id\": \"id\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"alertId\",\n \"id\": \"alertId\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_bodySchema
Alter Dataset Schema
Modifies the schema of an existing dataset by adding or altering columns
POST
/
api
/
data
/
v2
/
datasources
/
{datasetId}
/
schemas
http
POST /api/data/v2/datasources/{datasetId}/schemas HTTP/1.1
Host: {instance}.domo.com
x-domo-authentication: {session_token}
Content-Type: application/json
Accept: application/json
{
"columns": [
{
"name": "name",
"id": "name",
"type": "STRING",
"visible": true,
"order": 0
},
{
"name": "id",
"id": "id",
"type": "LONG",
"visible": true,
"order": 0
},
{
"name": "alertId",
"id": "alertId",
"type": "LONG",
"visible": true,
"order": 0
}
]
}curl --request POST \
--url https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas \
--header 'Content-Type: application/json' \
--header 'x-domo-authentication: <api-key>' \
--data '
{
"columns": [
{
"name": "name",
"id": "name",
"type": "STRING",
"visible": true,
"order": 0
},
{
"name": "id",
"id": "id",
"type": "LONG",
"visible": true,
"order": 0
},
{
"name": "alertId",
"id": "alertId",
"type": "LONG",
"visible": true,
"order": 0
}
]
}
'import requests
url = "https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas"
payload = { "columns": [
{
"name": "name",
"id": "name",
"type": "STRING",
"visible": True,
"order": 0
},
{
"name": "id",
"id": "id",
"type": "LONG",
"visible": True,
"order": 0
},
{
"name": "alertId",
"id": "alertId",
"type": "LONG",
"visible": True,
"order": 0
}
] }
headers = {
"x-domo-authentication": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-domo-authentication': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
columns: [
{name: 'name', id: 'name', type: 'STRING', visible: true, order: 0},
{name: 'id', id: 'id', type: 'LONG', visible: true, order: 0},
{name: 'alertId', id: 'alertId', type: 'LONG', visible: true, order: 0}
]
})
};
fetch('https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas', 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://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas",
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([
'columns' => [
[
'name' => 'name',
'id' => 'name',
'type' => 'STRING',
'visible' => true,
'order' => 0
],
[
'name' => 'id',
'id' => 'id',
'type' => 'LONG',
'visible' => true,
'order' => 0
],
[
'name' => 'alertId',
'id' => 'alertId',
'type' => 'LONG',
'visible' => true,
'order' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-domo-authentication: <api-key>"
],
]);
$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://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas"
payload := strings.NewReader("{\n \"columns\": [\n {\n \"name\": \"name\",\n \"id\": \"name\",\n \"type\": \"STRING\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"id\",\n \"id\": \"id\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"alertId\",\n \"id\": \"alertId\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-domo-authentication", "<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("https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas")
.header("x-domo-authentication", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"columns\": [\n {\n \"name\": \"name\",\n \"id\": \"name\",\n \"type\": \"STRING\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"id\",\n \"id\": \"id\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"alertId\",\n \"id\": \"alertId\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.domo.com/api/data/v2/datasources/{datasetId}/schemas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-domo-authentication"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"columns\": [\n {\n \"name\": \"name\",\n \"id\": \"name\",\n \"type\": \"STRING\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"id\",\n \"id\": \"id\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n },\n {\n \"name\": \"alertId\",\n \"id\": \"alertId\",\n \"type\": \"LONG\",\n \"visible\": true,\n \"order\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body⌘I