Get compiled Malloy model
curl --request GET \
--url https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}', 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://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}",
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://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}"
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://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}")
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{
"resource": "<string>",
"packageName": "<string>",
"path": "<string>",
"malloyVersion": "<string>",
"modelInfo": "<string>",
"sourceInfos": [
"<string>"
],
"queries": [
{
"name": "<string>",
"sourceName": "<string>",
"annotations": [
"<string>"
]
}
],
"sources": [
{
"name": "<string>",
"annotations": [
"<string>"
],
"views": [
{
"name": "<string>",
"annotations": [
"<string>"
]
}
],
"filters": [
{
"name": "<string>",
"dimension": "<string>",
"type": "equal",
"implicit": true,
"required": true,
"dimensionType": "<string>"
}
],
"givens": [
{
"name": "<string>",
"type": "<string>",
"annotations": [
"<string>"
],
"default": "<string>"
}
],
"authorize": [
"<string>"
]
}
],
"givens": [
{
"name": "<string>",
"type": "<string>",
"annotations": [
"<string>"
],
"default": "<string>"
}
]
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}models
Get compiled Malloy model
Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model’s structure, sources, and named queries for use in applications.
GET
/
environments
/
{environmentName}
/
packages
/
{packageName}
/
models
/
{path}
Get compiled Malloy model
curl --request GET \
--url https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}', 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://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}",
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://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}"
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://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization}.data.credibledata.com/api/v0/environments/{environmentName}/packages/{packageName}/models/{path}")
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{
"resource": "<string>",
"packageName": "<string>",
"path": "<string>",
"malloyVersion": "<string>",
"modelInfo": "<string>",
"sourceInfos": [
"<string>"
],
"queries": [
{
"name": "<string>",
"sourceName": "<string>",
"annotations": [
"<string>"
]
}
],
"sources": [
{
"name": "<string>",
"annotations": [
"<string>"
],
"views": [
{
"name": "<string>",
"annotations": [
"<string>"
]
}
],
"filters": [
{
"name": "<string>",
"dimension": "<string>",
"type": "equal",
"implicit": true,
"required": true,
"dimensionType": "<string>"
}
],
"givens": [
{
"name": "<string>",
"type": "<string>",
"annotations": [
"<string>"
],
"default": "<string>"
}
],
"authorize": [
"<string>"
]
}
],
"givens": [
{
"name": "<string>",
"type": "<string>",
"annotations": [
"<string>"
],
"default": "<string>"
}
]
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}{
"message": "<string>",
"details": "<string>"
}Authorizations
Path Parameters
Query Parameters
Response
Compiled Malloy model
Compiled Malloy model with sources, queries, and metadata
Was this page helpful?