Metadata API

The Metadata APIs allow you to fetch metadata for ThoughtSpot objects.

The Metadata APIs enable you to fetch metadata details for various objects in the ThoughtSpot system. For example, you may want to see the visualization headers of a particular answer or a pinboard.

Get visualization headers

Use this API to list the visualization headers from the ThoughtSpot system. The expected output includes a list of objects, each with information about the visualizations of the given pinboard or an answer.

Resource URL

get /tspublic/v1/metadata/listvizheaders

Request Parameters

id

ID of a particular answer or a pinboard.

Data type

string

Request Example

cURL
curl -X GET --header 'Accept: application/json' --header 'X-Requested-By: ThoughtSpot' 'https://<instance>/callosum/v1/tspublic/v1/metadata/listvizheaders?id=97begg839e-71b6-42ad-a980-20c38b4d6db5'
Request URL
https://<instance>/callosum/v1/tspublic/v1/metadata/listvizheaders?id=97be839e-71b6-42ggad-a980-20c38b4d6db5

Response Example

[
  {
    "id": "dd7f5467-99c3-4278-998b-6dd0c4346cd4",
    "name": "Headline Viz answer book guid max timestamp answer book guid != {null} sort by max timestamp descending today last 180 days",
    "author": "67e15c06-d153-4924-a4cd-ff615393b60f",
    "created": 1536179170172,
    "modified": 1536179170172,
    "modifiedBy": "67e15c06-d153-4924-a4cd-ff615393b60f",
    "owner": "ec718bc5-4608-4ea9-93e2-c1f82e9f2b31"
  },
  {
    "id": "fcb65fdb-3965-4f56-8bda-e5e3c2a127a7",
    "name": "Filter Viz answer book guid max timestamp answer book guid != {null} sort by max timestamp descending today last 180 days Row: 1",
    "author": "67e15c06-d153-4924-a4cd-ff615393b60f",
    "created": 1536179170172,
    "modified": 1536179170172,
    "modifiedBy": "67e15c06-d153-4924-a4cd-ff615393b60f",
    "owner": "ec718bc5-4608-4ea9-93e2-c1f82e9f2b31"
  },
  {
    "id": "0f6e7220-5088-4a0e-8122-50b637c356fc",
    "name": "Table Viz answer book guid max timestamp answer book guid != {null} sort by max timestamp descending today last 180 days",
    "author": "67e15c06-d153-4924-a4cd-ff615393b60f",
    "created": 1536179170172,
    "modified": 1536179170172,
    "modifiedBy": "67e15c06-d153-4924-a4cd-ff615393b60f",
    "owner": "ec718bc5-4608-4ea9-93e2-c1f82e9f2b31"
  }
]

Get object headers

Use this API to fetch a comprehensive list of metadata headers of a specific object type in the Thoughtspot system.

Resource URL

`get` /tspublic/v1/metadata/listobjectheaders

Request Parameters

type

Specifies the metadata object type.

Data type

string

Valid values

QUESTION_ANSWER_BOOK, PINBOARD_ANSWER_BOOK, QUESTION_ANSWER_SHEET, PINBOARD_ANSWER_SHEET, LOGICAL_COLUMN, LOGICAL_TABLE, LOGICAL_RELATIONSHIP, TAG, DATA_SOURCE

subtypes

Specifies the sub-types of metadata object.

This parameter only applies to the LOGICAL_TABLE type.
Data type

string

Valid values

ONE_TO_ONE_LOGICAL, WORKSHEET, PRIVATE_WORKSHEET, USER_DEFINED, AGGR_WORKSHEET

category

Specifies the metadata object category.

Data type

string

Valid values

ALL, MY, FAVORITE, REQUESTED

sort

Sort order of returned headers.

Data type

string

Valid values

DEFAULT, NAME, DISPLAY_NAME, AUTHOR, CREATED, MODIFIED

sortascending

A flag to specify the sort order.

Data type

boolean

Valid values

A null value defines the default order.

  • Choose true to set ascending order

  • Choose false to set descending order

offset

The batch offset to fetch the page headers.

Data type

integer

Valid values

The system default is -1 that implies first page.

batchsize

The batch size of the object.

Data type

integer

Valid values

A value of -1 implies no pagination.

tagname

A JSON array containing a set of tag names to filter headers by.

Data type

string

pattern

A pattern to match for object name.

Data type

string

Valid values

Use % for a wildcard match.

skipids

IDs of metadata objects to exclude.

Data type

string

fetchids

IDs of metadata objects to fetch.

Data type

string

auto_created

A flag that indicates whether to list auto-created objects only. A value of null signifies return all.

Data type

boolean

Request Example

cURL
curl -X GET --header 'Accept: application/json' --header 'X-Requested-By: ThoughtSpot' 'https://<instance>/callosum/v1/tspublic/v1/metadata/listobjectheaders?type=PINBOARD_ANSWER_BOOK&subtypes=WORKSHEET&category=ALL&sort=CREATED&offset=-1'
Request URL
https://<instance>/callosum/v1/tspublic/v1/metadata/listobjectheaders?type=PINBOARD_ANSWER_BOOK&subtypes=WORKSHEET&category=ALL&sort=CREATED&offset=-1

Response Example

[
  {
    "id": "7752fa9e-db22-415e-bf34-e082c4bc41c3",
    "name": "Basic Pinboard 1",
    "description": "This pinboard contains one TPCH based visualization",
    "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "created": 1450823023991,
    "modified": 1504281997165,
    "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "owner": "7752fa9e-db22-415e-bf34-e082c4bc41c3",
    "isAutoCreated": false,
    "isAutoDelete": false
  },
  {
    "id": "6715f768-8930-4180-9a3d-1efdbfaa8e7f",
    "name": "Headline Pinboard",
    "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "created": 1519940021267,
    "modified": 1519945210514,
    "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "owner": "6715f768-8930-4180-9a3d-1efdbfaa8e7f",
    "isAutoCreated": false,
    "isAutoDelete": false
  },
  {
    "id": "601be8e5-140e-477c-8812-843795306438",
    "name": "Pinboard Filter - datatypes",
    "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "created": 1519943239150,
    "modified": 1519944533160,
    "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "owner": "601be8e5-140e-477c-8812-843795306438",
    "isAutoCreated": false,
    "isAutoDelete": false
  }
]

Was this page helpful?