Logo
MicroStrategy REST API API Documentation

Update datasource of project.

PATCH {{baseUrl}}/api/projects/:id/datasources

Update selected information for a specific datasource for that project.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 login ID in the path of the request. You obtain the database source ID using GET /projects/{id}/datasources. You provide the information needed to update the datasource in the body parameter of the request; Currently either you can 'add' or 'remove' datasource from the project.

 

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
Content-Type
string




RESPONSES

status OK

{ "datasources": [ { "id": "A23BBC514D336D5B4FCE919FE19661A3", "name": "Tutorial Postgres", "description": "", "dateCreated": "2015-06-15T17:44:06.000+0000", "dateModified": "2021-10-30T18:24:17.000+0000", "acg": 255, "datasourceType": "normal", "database": { "type": "postgre_sql", "version": "postgre_sql_90", "connection": { "name": "TutorialWHLinux", "id": "A7543BCC4AC0AE818ED0F4B4357D2A61", "isEmbedded": false } }, "tablePrefix": "public.", "odbcVersion": "version3x", "intermediateStoreDbName": "", "intermediateStoreTableSpaceName": "", "dbms": { "name": "PostgreSQL", "id": "702780F3E3594D95AD4C85CE8F803306" }, "owner": { "name": "Administrator", "id": "54F3D26011D2896560009A8E67019608" }, "isAllowToRemove": false },
Curl
curl -X PATCH 'baseUrl/api/projects/:id/datasources?fields=' -H 'X-MSTR-AuthToken: authToken' -H 'Content-Type: application/json' -d '{"operationList":[{"op":"remove","path":"/id","value":"datasourceId"}]}'

ENDPOINTS