Logo
MicroStrategy REST API API Documentation

Upload data to a multi-table dataset

PUT {{baseUrl}}/api/datasets/:datasetId/uploadSessions/:uploadSessionId

Iteratively upload data to the Intelligence Server that matches formatting information provided by the previous (required) POST /datasets/{datasetId}/uploadSessions request. For large data volumes, the data should first be split into smaller chunks. This request should then be called until all chunks have been uploaded. Once all the data has been uploaded, call POST /datasets/{datasetId}/uploadSessions/{uploadSessionId}/publish to update the dataset with the newly uploaded data according to the previously specified update policy. You obtain the authorization token needed to execute the request using POST /auth/login. You obtain the project ID using GET /projects. You pass the authorization token and the project ID in the request header. You specify the dataset ID and the upload session ID in the path of the request; you obtain the dataset ID from POST /datasets/models, and the upload session ID from POST /datasets/{datasetId}/uploadSessions. You provide information about each table in the body parameter, including the table name, the index of each chunk of data, and the base64 encoded chunk of data.

Data formatting before base64 encoding:

In 'ROW' orientation, each subarray corresponds to data in a row:

[
    [data_col1_row1, data_col2_row1],
    [data_col1_row2, data_col2_row2]
]

In 'COLUMN' orientation, each subarray corresponds to data in a column:

[
    [data_col1_row1, data_col1_row2],
    [data_col2_row1, data_col2_row2]
]

If data contain values of Date, DateTime or Time type, only ISO8601 date formats are supported.

 

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




RESPONSES

Curl
curl -X PUT 'baseUrl/api/datasets/:datasetId/uploadSessions/:uploadSessionId?fields=' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-ProjectID: projectId' -H 'Content-Type: application/json' -d '{"data":"W1siYWJjIiwxMjM0NS4yMjJdXQ==","index":1,"tableName":"SALES_TABLE"}'

ENDPOINTS