Update a data model external data model's object
You can try out this workflow at REST API Playground.
Learn more about Strategy REST API Playground here.
This workflow sample demonstrates how to update an external data model's object through the Modeling service.
Get the authorization token needed to execute the request with POST /api/auth/login.
Get the project ID from GET /api/projects.
Changesets are used in this workflow. For information on how to create and use changesets, see Changesets.
You can update an external data model's object in a data model using the following endpoint: PATCH /api/model/dataModels/{dataModelId}/externalDataModels/{externalDataModelId}/objects/{objectId}. Only "hidden" and "alias" fields can be modified by this API.
Sample Request Header:
"accept": "application/json"
"X-MSTR-AuthToken": "o0ak9privdo27nfo798j40m8aa"
"X-MSTR-MS-Changeset": "805C5F3FB78A436FAE37C943471C24AD"
Sample Request Body:
{
"hidden": true,
"alias": "Churn Alias"
}
Sample Curl:
curl -X PATCH "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/04DCF4F028354FC0AE4B8120CB1983A6/externalDataModels/AE2FC8E446B14162BF2BCAC64981D5A2/objects/B44A2F49F6B6441796FCA511F1BBFDA5" -H "accept: application/json" -H "X-MSTR-AuthToken: o0ak9privdo27nfo798j40m8aa" -H "X-MSTR-MS-Changeset: 805C5F3FB78A436FAE37C943471C24AD" -H "Content-Type: application/json" -d '{"hidden":true,"alias":"Churn Alias"}'
Sample Response Body:
{
"objectId": "B44A2F49F6B6441796FCA511F1BBFDA5",
"subType": "attribute",
"name": "Churn",
"hidden": true,
"alias": "Churn Alias"
}
Response Code: 200 (External data model's object is updated successfully in the changeset.)