curl --request GET \
--url https://api.example.com/api/data/{name}/{version}/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/data/{name}/{version}/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/data/{name}/{version}/context', 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://api.example.com/api/data/{name}/{version}/context",
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://api.example.com/api/data/{name}/{version}/context"
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://api.example.com/api/data/{name}/{version}/context")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/data/{name}/{version}/context")
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{
"api": "<string>",
"title": "<string>",
"description": "<string>",
"version": 123,
"status": "draft",
"context_hash": "<string>",
"endpoint": "<string>",
"source": "<string>",
"grain": "<string>",
"columns": [
{
"name": "<string>",
"type": "<string>",
"description": "",
"business_name": "<string>",
"nullable": true,
"is_key": false,
"filters": [
"eq"
],
"sortable": false,
"glossary_terms": [
{
"urn": "<string>",
"name": "<string>",
"definition": "<string>"
}
],
"tags": [
"<string>"
],
"sensitive": false,
"upstream": [
"<string>"
],
"masked": "<string>",
"profile": {
"null_fraction": 123,
"distinct_count": 123,
"min": "<string>",
"max": "<string>"
},
"dq_failing": [
"<string>"
],
"deprecated": {
"target": "<string>",
"note": "<string>",
"decommission_at": "2023-11-07T05:31:56Z"
}
}
],
"default_sort": [
"<string>"
],
"default_page_size": 123,
"max_page_size": 123,
"examples": [
{
"title": "<string>",
"params": {}
}
],
"pinned": {
"title": "<string>",
"description": "<string>",
"owners": [
{
"name": "<string>",
"type": "<string>"
}
],
"links": [
{
"url": "<string>",
"label": "<string>"
}
],
"domain": "<string>",
"data_product": "<string>",
"properties": {},
"upstream_tables": [
"<string>"
],
"documents": [
{
"url": "<string>",
"label": "<string>"
}
]
},
"live": {
"as_of": "2023-11-07T05:31:56Z",
"row_count": 123,
"dq": {
"status": "pass",
"table": "<string>",
"checked_at": "2023-11-07T05:31:56Z",
"passed": 0,
"total": 0,
"failing": [
"<string>"
]
},
"incidents": [
{
"title": "<string>",
"table": "<string>",
"type": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"deprecations": [
{
"target": "<string>",
"note": "<string>",
"decommission_at": "2023-11-07T05:31:56Z"
}
],
"warnings": [
"<string>"
]
},
"pack": {
"name": "<string>",
"version": "<string>",
"text": "<string>"
},
"notes": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}A version's context envelope
The contract, DataHub’s context and the live state, resolved as you.
format=markdown (or Accept: text/markdown) is for agents;
format=odcs is an Open Data Contract Standard v3 document.
curl --request GET \
--url https://api.example.com/api/data/{name}/{version}/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/data/{name}/{version}/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/data/{name}/{version}/context', 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://api.example.com/api/data/{name}/{version}/context",
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://api.example.com/api/data/{name}/{version}/context"
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://api.example.com/api/data/{name}/{version}/context")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/data/{name}/{version}/context")
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{
"api": "<string>",
"title": "<string>",
"description": "<string>",
"version": 123,
"status": "draft",
"context_hash": "<string>",
"endpoint": "<string>",
"source": "<string>",
"grain": "<string>",
"columns": [
{
"name": "<string>",
"type": "<string>",
"description": "",
"business_name": "<string>",
"nullable": true,
"is_key": false,
"filters": [
"eq"
],
"sortable": false,
"glossary_terms": [
{
"urn": "<string>",
"name": "<string>",
"definition": "<string>"
}
],
"tags": [
"<string>"
],
"sensitive": false,
"upstream": [
"<string>"
],
"masked": "<string>",
"profile": {
"null_fraction": 123,
"distinct_count": 123,
"min": "<string>",
"max": "<string>"
},
"dq_failing": [
"<string>"
],
"deprecated": {
"target": "<string>",
"note": "<string>",
"decommission_at": "2023-11-07T05:31:56Z"
}
}
],
"default_sort": [
"<string>"
],
"default_page_size": 123,
"max_page_size": 123,
"examples": [
{
"title": "<string>",
"params": {}
}
],
"pinned": {
"title": "<string>",
"description": "<string>",
"owners": [
{
"name": "<string>",
"type": "<string>"
}
],
"links": [
{
"url": "<string>",
"label": "<string>"
}
],
"domain": "<string>",
"data_product": "<string>",
"properties": {},
"upstream_tables": [
"<string>"
],
"documents": [
{
"url": "<string>",
"label": "<string>"
}
]
},
"live": {
"as_of": "2023-11-07T05:31:56Z",
"row_count": 123,
"dq": {
"status": "pass",
"table": "<string>",
"checked_at": "2023-11-07T05:31:56Z",
"passed": 0,
"total": 0,
"failing": [
"<string>"
]
},
"incidents": [
{
"title": "<string>",
"table": "<string>",
"type": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"deprecations": [
{
"target": "<string>",
"note": "<string>",
"decommission_at": "2023-11-07T05:31:56Z"
}
],
"warnings": [
"<string>"
]
},
"pack": {
"name": "<string>",
"version": "<string>",
"text": "<string>"
},
"notes": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The API's name.
^[a-z][a-z0-9_]{1,62}$'v', or 'draft' (owner only).
^(v\d{1,6}|draft)$Query Parameters
^(json|markdown|odcs)$Response
Successful Response
Everything a consumer needs to use a version correctly.
A version's lifecycle. Only draft can be edited.
draft, published, retired Show child attributes
Show child attributes
Show child attributes
Show child attributes
What DataHub said about the source when the version was published.
Also the API's title and description at publish, so a later rename doesn't change what a published version says about itself.
Show child attributes
Show child attributes
Resolved per request (briefly cached).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?

