http
GET https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}
X-DOMO-Developer-Token: YOUR_TOKEN
Content-Type: application/jsoncurl --request GET \
--url https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId} \
--header 'X-DOMO-Developer-Token: <api-key>'import requests
url = "https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}"
headers = {"X-DOMO-Developer-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-DOMO-Developer-Token': '<api-key>'}};
fetch('https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}', 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/query/v1/functions/template/{beastmodeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-DOMO-Developer-Token: <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"
"net/http"
"io"
)
func main() {
url := "https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-DOMO-Developer-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}")
.header("X-DOMO-Developer-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-DOMO-Developer-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 232,
"name": "% Change - Orders",
"owner": 27,
"locked": false,
"global": false,
"expression": "(CASE WHEN (sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < (28 + (52 * 7))) AND (DateDiff(Current_Date(),`Date`) > (52 * 7))) THEN `Orders` END )) = 0) THEN 0 ELSE ((sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < 28) AND (DateDiff(Current_Date(),`Date`) > 0)) THEN `Orders` END )) - sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < (28 + (52 * 7))) AND (DateDiff(Current_Date(),`Date`) > (52 * 7))) THEN `Orders` END ))) / sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < (28 + (52 * 7))) AND (DateDiff(Current_Date(),`Date`) > (52 * 7))) THEN `Orders` END ))) END )",
"checkSum": "4041d1731163b41ae86552ebb46f8a2f1d5aecd5",
"links": [
{
"resource": {
"type": "DATA_SOURCE",
"id": "32e6af61-c725-487a-8a4a-a46fbfed9fb1"
},
"visible": true,
"active": false,
"valid": "VALID"
}
],
"legacyId": "calculation_6ca6ab70-412a-4394-82d7-d6f648758907",
"lastModified": 1654190830737,
"created": 1654190830737,
"aggregated": true,
"analytic": false,
"nonAggregatedColumns": [],
"dataType": "DECIMAL",
"status": "VALID",
"cacheWindow": "day",
"columnPositions": [
{
"columnName": "`Date`",
"columnPosition": 67
},
{
"columnName": "`Date`",
"columnPosition": 123
},
{
"columnName": "`Orders`",
"columnPosition": 149
}
],
"functions": [
"DOMO_OP_MULTIPLY",
"ADDDATE",
"DOMO_OP_ADD",
"SUM",
"DOMO_OP_SUBTRACT",
"DATEDIFF",
"DOMO_OP_DIVIDE"
],
"functionTemplateDependencies": [],
"archived": false,
"hidden": false,
"variable": false
}Beast Modes API
Get Beast Mode by Id
Gets a specified Beast Mode calculation.
GET
/
api
/
query
/
v1
/
functions
/
template
/
{beastmodeId}
http
GET https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}
X-DOMO-Developer-Token: YOUR_TOKEN
Content-Type: application/jsoncurl --request GET \
--url https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId} \
--header 'X-DOMO-Developer-Token: <api-key>'import requests
url = "https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}"
headers = {"X-DOMO-Developer-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-DOMO-Developer-Token': '<api-key>'}};
fetch('https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}', 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/query/v1/functions/template/{beastmodeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-DOMO-Developer-Token: <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"
"net/http"
"io"
)
func main() {
url := "https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-DOMO-Developer-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}")
.header("X-DOMO-Developer-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.domo.com/api/query/v1/functions/template/{beastmodeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-DOMO-Developer-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 232,
"name": "% Change - Orders",
"owner": 27,
"locked": false,
"global": false,
"expression": "(CASE WHEN (sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < (28 + (52 * 7))) AND (DateDiff(Current_Date(),`Date`) > (52 * 7))) THEN `Orders` END )) = 0) THEN 0 ELSE ((sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < 28) AND (DateDiff(Current_Date(),`Date`) > 0)) THEN `Orders` END )) - sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < (28 + (52 * 7))) AND (DateDiff(Current_Date(),`Date`) > (52 * 7))) THEN `Orders` END ))) / sum((CASE WHEN ((DateDiff(AddDate(Current_Date(),-1),`Date`) < (28 + (52 * 7))) AND (DateDiff(Current_Date(),`Date`) > (52 * 7))) THEN `Orders` END ))) END )",
"checkSum": "4041d1731163b41ae86552ebb46f8a2f1d5aecd5",
"links": [
{
"resource": {
"type": "DATA_SOURCE",
"id": "32e6af61-c725-487a-8a4a-a46fbfed9fb1"
},
"visible": true,
"active": false,
"valid": "VALID"
}
],
"legacyId": "calculation_6ca6ab70-412a-4394-82d7-d6f648758907",
"lastModified": 1654190830737,
"created": 1654190830737,
"aggregated": true,
"analytic": false,
"nonAggregatedColumns": [],
"dataType": "DECIMAL",
"status": "VALID",
"cacheWindow": "day",
"columnPositions": [
{
"columnName": "`Date`",
"columnPosition": 67
},
{
"columnName": "`Date`",
"columnPosition": 123
},
{
"columnName": "`Orders`",
"columnPosition": 149
}
],
"functions": [
"DOMO_OP_MULTIPLY",
"ADDDATE",
"DOMO_OP_ADD",
"SUM",
"DOMO_OP_SUBTRACT",
"DATEDIFF",
"DOMO_OP_DIVIDE"
],
"functionTemplateDependencies": [],
"archived": false,
"hidden": false,
"variable": false
}Authorizations
Domo Developer Token for authentication
Path Parameters
ID of the BeastMode
Response
200 - application/json
Successful response
⌘I