Retrieve a topic
curl --request GET \
--url https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}', 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}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"topic": {
"name": "Customers",
"base_view_name": "main__customers",
"label": "Customers",
"default_filters": {},
"join_via_map": {
"main__orders": [],
"main__order_items": [
"main__orders"
]
},
"join_via_map_key_order": [
"main__orders",
"main__order_items"
],
"ignored_props": [],
"always_where_filters": {},
"extension_model_id": "5da4e30e-45e2-4693-b87d-51c39d69963f",
"has_frozen_join_via_map": true,
"relationships": [
{
"left_view_name": "main__orders",
"right_view_name": "main__customers",
"join_type": "ALWAYS_LEFT",
"sql": "${main__orders.customer_id} = ${main__customers.id}",
"id": "main__orders_main__customers",
"type": "ASSUMED_MANY_TO_ONE",
"ignored": false,
"bidirectional": false
}
],
"ide_file_name": "Customers.topic",
"views": [
{
"name": "main__customers",
"label": "Customers",
"table_name": "customers",
"schema": "main",
"schema_label": "Main",
"extension_model_id": "5da4e30e-45e2-4693-b87d-51c39d69963f",
"ide_file_name": "main/customers.view",
"yaml_path": "main__customers.view",
"filter_only_fields": [],
"is_pseudo_display_view": false,
"primary_key": [
{
"type": "field",
"field_name": "main__customers.id"
}
],
"dimensions": [
{
"field_name": "country",
"view_name": "main__customers",
"data_type": "STRING",
"description": "User's country",
"view_label": "Customers",
"is_dimension": true,
"fully_qualified_name": "main__customers.country"
},
{
"field_name": "created_date",
"view_name": "main__customers",
"data_type": "TIMESTAMP",
"time_frames": [
null,
"DATE",
"WEEK",
"MONTH",
"QUARTER",
"YEAR"
],
"date_type": "DATE",
"description": "Date of user creation",
"parent_field": "created_date",
"parent_label": "Created Date",
"view_label": "Customers",
"group_label": "Created Date",
"is_dimension": true,
"is_group_parent_field": true,
"fully_qualified_name": "main__customers.created_date"
}
],
"measures": [
{
"type": "aggregation",
"field_name": "count",
"view_name": "main__customers",
"aggregate_type": "COUNT",
"data_type": "NUMBER",
"ignored": false,
"label": "Customers Count",
"format": "NUMBER_0",
"view_label": "Customers",
"display_sql": "COUNT(*)",
"dialect_sql": "COUNT(*)",
"fully_qualified_name": "main__customers.count"
}
]
}
]
}
}Topics
Retrieve a topic
Retrieve a topic in a model by name.
GET
/
v1
/
models
/
{modelId}
/
topic
/
{topicName}
Retrieve a topic
curl --request GET \
--url https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}', 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}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.omniapp.co/api/v1/models/{modelId}/topic/{topicName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"topic": {
"name": "Customers",
"base_view_name": "main__customers",
"label": "Customers",
"default_filters": {},
"join_via_map": {
"main__orders": [],
"main__order_items": [
"main__orders"
]
},
"join_via_map_key_order": [
"main__orders",
"main__order_items"
],
"ignored_props": [],
"always_where_filters": {},
"extension_model_id": "5da4e30e-45e2-4693-b87d-51c39d69963f",
"has_frozen_join_via_map": true,
"relationships": [
{
"left_view_name": "main__orders",
"right_view_name": "main__customers",
"join_type": "ALWAYS_LEFT",
"sql": "${main__orders.customer_id} = ${main__customers.id}",
"id": "main__orders_main__customers",
"type": "ASSUMED_MANY_TO_ONE",
"ignored": false,
"bidirectional": false
}
],
"ide_file_name": "Customers.topic",
"views": [
{
"name": "main__customers",
"label": "Customers",
"table_name": "customers",
"schema": "main",
"schema_label": "Main",
"extension_model_id": "5da4e30e-45e2-4693-b87d-51c39d69963f",
"ide_file_name": "main/customers.view",
"yaml_path": "main__customers.view",
"filter_only_fields": [],
"is_pseudo_display_view": false,
"primary_key": [
{
"type": "field",
"field_name": "main__customers.id"
}
],
"dimensions": [
{
"field_name": "country",
"view_name": "main__customers",
"data_type": "STRING",
"description": "User's country",
"view_label": "Customers",
"is_dimension": true,
"fully_qualified_name": "main__customers.country"
},
{
"field_name": "created_date",
"view_name": "main__customers",
"data_type": "TIMESTAMP",
"time_frames": [
null,
"DATE",
"WEEK",
"MONTH",
"QUARTER",
"YEAR"
],
"date_type": "DATE",
"description": "Date of user creation",
"parent_field": "created_date",
"parent_label": "Created Date",
"view_label": "Customers",
"group_label": "Created Date",
"is_dimension": true,
"is_group_parent_field": true,
"fully_qualified_name": "main__customers.created_date"
}
],
"measures": [
{
"type": "aggregation",
"field_name": "count",
"view_name": "main__customers",
"aggregate_type": "COUNT",
"data_type": "NUMBER",
"ignored": false,
"label": "Customers Count",
"format": "NUMBER_0",
"view_label": "Customers",
"display_sql": "COUNT(*)",
"dialect_sql": "COUNT(*)",
"fully_qualified_name": "main__customers.count"
}
]
}
]
}
}Authorizations
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Path Parameters
The ID of the model.
Example:
"123e4567-e89b-12d3-a456-426614174000"
The name of the topic.
Example:
"sales_analytics"
Response
Indicates the request was successful
Details about the topic. Regular topics mirror the IDE parameters for topic files. When topicName resolves to a composite topic, the response mirrors the composite topic IDE parameters instead.
- Regular topic
- Composite topic
Show child attributes
Show child attributes
Was this page helpful?

