Create data view
import requests
url = "https://api.datagrid.com/v1/data-views"
payload = {
"bigquery_dataset_name": "<string>",
"knowledge_id": "<string>",
"service_account_id": "<string>"
}
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({
bigquery_dataset_name: '<string>',
knowledge_id: '<string>',
service_account_id: '<string>'
})
};
fetch('https://api.datagrid.com/v1/data-views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/data-views \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bigquery_dataset_name": "<string>",
"knowledge_id": "<string>",
"service_account_id": "<string>"
}
'{
"object": "data_view",
"id": "<string>",
"bigquery_dataset_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"knowledge_id": "<string>",
"service_account_id": "<string>",
"credits": {
"consumed": 123
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Data Views
Create data view
Creates a new data view for a knowledge source, providing controlled access through a service account. This endpoint requires credits and meters setup work based on the number of warehouse operations performed for the request.
POST
/
data-views
Create data view
import requests
url = "https://api.datagrid.com/v1/data-views"
payload = {
"bigquery_dataset_name": "<string>",
"knowledge_id": "<string>",
"service_account_id": "<string>"
}
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({
bigquery_dataset_name: '<string>',
knowledge_id: '<string>',
service_account_id: '<string>'
})
};
fetch('https://api.datagrid.com/v1/data-views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/data-views \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bigquery_dataset_name": "<string>",
"knowledge_id": "<string>",
"service_account_id": "<string>"
}
'{
"object": "data_view",
"id": "<string>",
"bigquery_dataset_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"knowledge_id": "<string>",
"service_account_id": "<string>",
"credits": {
"consumed": 123
}
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}For a complete guide on setting up Data Views including creating knowledge, service accounts, and obtaining BigQuery credentials, see the Creating Data Views Introduction.
Authorizations
Body
application/json
Response
Successfully created data view
The data_view object represents a view into a knowledge source that can be accessed through a service account.