Logo
MicroStrategy REST API API Documentation

Get catalog settings for a specific datasource

GET {{baseUrl}}/api/datasources/:id/catalog/settings

Get catalog settings for a specific datasource. You obtain the authorization token needed to execute the request using POST /auth/login; You pass the authorization token in the request header. You specify the datasource ID in the path of the request; You obtain the catalog settings using GET /datasources/{id}/catalog/settings.

 

Body PARAM

Key Datatype Required Description 
fields
null Comma-separated, top-level field whitelist that allows the client to selectively retrieve part of the response model. If specified, extra filtering is applied, and for top-level object (if root model is an array, each array element), only the listed fields are kept in the response. For example, "id,elements" keeps only the "id" field and whole "elements" array field, omitting all other fields in the top-level response model.



HEADERS

Key Datatype Required Description 
X-MSTR-AuthToken
string (Required) Authorization token
X-MSTR-ProjectID
string (Required) Project ID




RESPONSES

status OK

{ "catalogMode": { "retrievalMode": "catalog_sql", "namespaceMode": "current", "cacheMode": "table" }, "catalogSqls": { "defaultSqls": [ { "mode": "current", "type": "table", "sql": "SELECT DISTINCT TABLE_SCHEMA as NAME_SPACE, TABLE_NAME as TAB_NAME from INFORMATION_SCHEMA.TABLES" }, { "mode": "current", "type": "column", "sql": "SELECT DISTINCT nspname as NAME_SPACE, relname as TAB_NAME, attname as COL_NAME, typname as DATA_TYPE, COALESCE(B.CHARACTER_MAXIMUM_LENGTH, attlen) as DATA_LEN, NUMERIC_PRECISION as DATA_PREC, NUMERIC_SCALE as DATA_SCALE FROM pg_attribute A JOIN pg_class C ON A.attrelid = C.oid JOIN pg_namespace N on C.relnamespace = N.oid JOIN pg_type T on A.atttypid = T.oid JOIN INFORMATION_SCHEMA.COLUMNS B on A.attname = B.COLUMN_NAME AND C.relname = B.TABLE_NAME AND N.nspname = B.TABLE_SCHEMA WHERE relname IN (#TABLE_LIST#) AND attnum > 0 Order by 1,2,3" } ], "currentSqls": [ { "mode": "current", "type": "table", "sql": "SELECT DISTINCT TABLE_SCHEMA as NAME_SPACE, TABLE_NAME as TAB_NAME from INFORMATION_SCHEMA.TABLES", "default": true }, { "mode": "current", "type": "
Curl
curl -X GET 'baseUrl/api/datasources/:id/catalog/settings?fields=' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-ProjectID: projectId'

ENDPOINTS