curl --request POST \
--url https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityIds": [
"<string>"
],
"fieldNames": [
"<string>"
],
"parts": [],
"tables": [
"<string>"
],
"groupKinds": [],
"fieldLimit": 123
}
'import requests
url = "https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id"
payload = {
"entityIds": ["<string>"],
"fieldNames": ["<string>"],
"parts": [],
"tables": ["<string>"],
"groupKinds": [],
"fieldLimit": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityIds: ['<string>'],
fieldNames: ['<string>'],
parts: [],
tables: ['<string>'],
groupKinds: [],
fieldLimit: 123
})
};
fetch('https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id', 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://developer.synq.io/api/entities/semantic-models/v1alpha/by-id",
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([
'entityIds' => [
'<string>'
],
'fieldNames' => [
'<string>'
],
'parts' => [
],
'tables' => [
'<string>'
],
'groupKinds' => [
],
'fieldLimit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id"
payload := strings.NewReader("{\n \"entityIds\": [\n \"<string>\"\n ],\n \"fieldNames\": [\n \"<string>\"\n ],\n \"parts\": [],\n \"tables\": [\n \"<string>\"\n ],\n \"groupKinds\": [],\n \"fieldLimit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://developer.synq.io/api/entities/semantic-models/v1alpha/by-id")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityIds\": [\n \"<string>\"\n ],\n \"fieldNames\": [\n \"<string>\"\n ],\n \"parts\": [],\n \"tables\": [\n \"<string>\"\n ],\n \"groupKinds\": [],\n \"fieldLimit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityIds\": [\n \"<string>\"\n ],\n \"fieldNames\": [\n \"<string>\"\n ],\n \"parts\": [],\n \"tables\": [\n \"<string>\"\n ],\n \"groupKinds\": [],\n \"fieldLimit\": 123\n}"
response = http.request(request)
puts response.read_body{
"semanticModels": [
{
"osi": {
"osiVersion": "<string>",
"document": "<string>"
},
"identityGroup": {
"canonicalEntityId": "<string>",
"members": [
{
"entityId": "<string>"
}
]
},
"requestedEntityIds": [
"<string>"
],
"provenance": {
"entityId": "<string>"
},
"nativeName": "<string>",
"summary": {
"fieldCounts": [
{
"kind": "FIELD_GROUP_KIND_UNSPECIFIED",
"count": 123
}
],
"relationshipCount": 123,
"tableCount": 123,
"kind": "SEMANTIC_MODEL_KIND_UNSPECIFIED"
},
"marks": {
"entityId": "<string>",
"identityGroup": {
"canonicalEntityId": "<string>",
"members": [
{
"entityId": "<string>"
}
]
},
"certification": {
"entityId": "<string>",
"certifiedBy": {
"name": "<string>",
"email": {
"userEmail": "jsmith@example.com"
},
"via": "VIA_UNSPECIFIED"
},
"certifiedAt": "2023-01-15T01:30:15.01Z",
"reason": "<string>",
"definitionChanged": true
},
"deprecation": {
"marked": {
"entityId": "<string>",
"deprecatedBy": {
"name": "<string>",
"email": {
"userEmail": "jsmith@example.com"
},
"via": "VIA_UNSPECIFIED"
},
"deprecatedAt": "2023-01-15T01:30:15.01Z",
"reason": "<string>"
}
}
},
"declarationText": {
"text": "<string>",
"language": "LANGUAGE_UNSPECIFIED"
},
"stateAt": "2023-01-15T01:30:15.01Z",
"definitionFindings": [
{
"kind": "KIND_UNSPECIFIED",
"level": "LEVEL_UNSPECIFIED",
"text": "<string>",
"fields": [
{
"group": "<string>",
"fieldName": "<string>"
}
],
"relationshipIndexes": [
123
],
"tables": [
"<string>"
],
"names": [
"<string>"
],
"declaredLines": [
{
"startLine": 123,
"endLine": 123
}
]
}
],
"declarationTextMissingReason": "MISSING_REASON_UNSPECIFIED",
"definitionChangedAt": "2023-01-15T01:30:15.01Z",
"declarationTextRecommendationId": "<string>"
}
]
}BatchGetSemanticModels
Read the semantic model of each asked entity. Any member of an identity group addresses the group, so a dbt model and the table it builds give the same model. The response has one entry for each identity group of the request: an identity group with no semantic model gets an entry with no model.
curl --request POST \
--url https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityIds": [
"<string>"
],
"fieldNames": [
"<string>"
],
"parts": [],
"tables": [
"<string>"
],
"groupKinds": [],
"fieldLimit": 123
}
'import requests
url = "https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id"
payload = {
"entityIds": ["<string>"],
"fieldNames": ["<string>"],
"parts": [],
"tables": ["<string>"],
"groupKinds": [],
"fieldLimit": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityIds: ['<string>'],
fieldNames: ['<string>'],
parts: [],
tables: ['<string>'],
groupKinds: [],
fieldLimit: 123
})
};
fetch('https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id', 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://developer.synq.io/api/entities/semantic-models/v1alpha/by-id",
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([
'entityIds' => [
'<string>'
],
'fieldNames' => [
'<string>'
],
'parts' => [
],
'tables' => [
'<string>'
],
'groupKinds' => [
],
'fieldLimit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id"
payload := strings.NewReader("{\n \"entityIds\": [\n \"<string>\"\n ],\n \"fieldNames\": [\n \"<string>\"\n ],\n \"parts\": [],\n \"tables\": [\n \"<string>\"\n ],\n \"groupKinds\": [],\n \"fieldLimit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://developer.synq.io/api/entities/semantic-models/v1alpha/by-id")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityIds\": [\n \"<string>\"\n ],\n \"fieldNames\": [\n \"<string>\"\n ],\n \"parts\": [],\n \"tables\": [\n \"<string>\"\n ],\n \"groupKinds\": [],\n \"fieldLimit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/entities/semantic-models/v1alpha/by-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityIds\": [\n \"<string>\"\n ],\n \"fieldNames\": [\n \"<string>\"\n ],\n \"parts\": [],\n \"tables\": [\n \"<string>\"\n ],\n \"groupKinds\": [],\n \"fieldLimit\": 123\n}"
response = http.request(request)
puts response.read_body{
"semanticModels": [
{
"osi": {
"osiVersion": "<string>",
"document": "<string>"
},
"identityGroup": {
"canonicalEntityId": "<string>",
"members": [
{
"entityId": "<string>"
}
]
},
"requestedEntityIds": [
"<string>"
],
"provenance": {
"entityId": "<string>"
},
"nativeName": "<string>",
"summary": {
"fieldCounts": [
{
"kind": "FIELD_GROUP_KIND_UNSPECIFIED",
"count": 123
}
],
"relationshipCount": 123,
"tableCount": 123,
"kind": "SEMANTIC_MODEL_KIND_UNSPECIFIED"
},
"marks": {
"entityId": "<string>",
"identityGroup": {
"canonicalEntityId": "<string>",
"members": [
{
"entityId": "<string>"
}
]
},
"certification": {
"entityId": "<string>",
"certifiedBy": {
"name": "<string>",
"email": {
"userEmail": "jsmith@example.com"
},
"via": "VIA_UNSPECIFIED"
},
"certifiedAt": "2023-01-15T01:30:15.01Z",
"reason": "<string>",
"definitionChanged": true
},
"deprecation": {
"marked": {
"entityId": "<string>",
"deprecatedBy": {
"name": "<string>",
"email": {
"userEmail": "jsmith@example.com"
},
"via": "VIA_UNSPECIFIED"
},
"deprecatedAt": "2023-01-15T01:30:15.01Z",
"reason": "<string>"
}
}
},
"declarationText": {
"text": "<string>",
"language": "LANGUAGE_UNSPECIFIED"
},
"stateAt": "2023-01-15T01:30:15.01Z",
"definitionFindings": [
{
"kind": "KIND_UNSPECIFIED",
"level": "LEVEL_UNSPECIFIED",
"text": "<string>",
"fields": [
{
"group": "<string>",
"fieldName": "<string>"
}
],
"relationshipIndexes": [
123
],
"tables": [
"<string>"
],
"names": [
"<string>"
],
"declaredLines": [
{
"startLine": 123,
"endLine": 123
}
]
}
],
"declarationTextMissingReason": "MISSING_REASON_UNSPECIFIED",
"definitionChangedAt": "2023-01-15T01:30:15.01Z",
"declarationTextRecommendationId": "<string>"
}
]
}Authorizations
Body
Return only the fields with these names: Field.name. Empty returns every field. A group with no field left is left out. Use it to read single fields of a large model. Ignored for SEMANTIC_MODEL_FORMAT_OSI, which always returns the whole model.
10001 - 1024The form of the model in the response. SEMANTIC_MODEL_FORMAT_OSI returns the whole model as one document when the parts ask for the fields. It has no readings, no declaration text and no definition findings, and it ignores the field options.
SEMANTIC_MODEL_FORMAT_UNSPECIFIED, SEMANTIC_MODEL_FORMAT_OSI The parts of each model to return. The summary is always returned, so a request with no part returns the summary only.
16SemanticModelPart is one part of a semantic model that a read returns.
SEMANTIC_MODEL_PART_UNSPECIFIED, SEMANTIC_MODEL_PART_SUMMARY, SEMANTIC_MODEL_PART_FIELDS, SEMANTIC_MODEL_PART_DEFINITIONS, SEMANTIC_MODEL_PART_READINGS, SEMANTIC_MODEL_PART_DECLARATION_TEXT, SEMANTIC_MODEL_PART_DEFINITION_CHECKS, SEMANTIC_MODEL_PART_MARKS Return only the fields of groups of these kinds. Empty returns the fields of every kind. Ignored for SEMANTIC_MODEL_FORMAT_OSI.
16FieldGroupKind is the role the fields of a group play. It is the role of each of its fields.
FIELD_GROUP_KIND_UNSPECIFIED, FIELD_GROUP_KIND_COLUMNS, FIELD_GROUP_KIND_DIMENSIONS, FIELD_GROUP_KIND_MEASURES, FIELD_GROUP_KIND_METRICS, FIELD_GROUP_KIND_ENTITIES, FIELD_GROUP_KIND_FACTS, FIELD_GROUP_KIND_FILTERS, FIELD_GROUP_KIND_PARAMETERS