{"id":18698890,"url":"https://github.com/tiagosiebler/microstrategy-api-node","last_synced_at":"2025-04-12T07:33:16.778Z","repository":{"id":48288429,"uuid":"250520419","full_name":"tiagosiebler/microstrategy-api-node","owner":"tiagosiebler","description":"A light node SDK for the MicroStrategy REST API \u0026 Task API.","archived":false,"fork":false,"pushed_at":"2021-08-03T07:07:17.000Z","size":502,"stargazers_count":3,"open_issues_count":10,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T18:57:10.822Z","etag":null,"topics":["microstrategy","microstrategy-node","microstrategyrest","microstrategytaskapi","nodejs","npm","promise","taskapi"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/microstrategy","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiagosiebler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["tiagosiebler","Jestemrique"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-03-27T11:46:58.000Z","updated_at":"2021-04-26T21:19:11.000Z","dependencies_parsed_at":"2022-08-25T22:10:10.596Z","dependency_job_id":null,"html_url":"https://github.com/tiagosiebler/microstrategy-api-node","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagosiebler%2Fmicrostrategy-api-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagosiebler%2Fmicrostrategy-api-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagosiebler%2Fmicrostrategy-api-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiagosiebler%2Fmicrostrategy-api-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiagosiebler","download_url":"https://codeload.github.com/tiagosiebler/microstrategy-api-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248534416,"owners_count":21120323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["microstrategy","microstrategy-node","microstrategyrest","microstrategytaskapi","nodejs","npm","promise","taskapi"],"created_at":"2024-11-07T11:30:08.124Z","updated_at":"2025-04-12T07:33:16.399Z","avatar_url":"https://github.com/tiagosiebler.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tiagosiebler","https://github.com/sponsors/Jestemrique"],"categories":[],"sub_categories":[],"readme":"# MicroStrategy REST API [![npm version](https://img.shields.io/npm/v/microstrategy.svg)][1] [![npm size](https://img.shields.io/bundlephobia/min/microstrategy.svg)][1] [![npm downloads](https://img.shields.io/npm/dt/microstrategy.svg)][1]\n[![CircleCI](https://circleci.com/gh/tiagosiebler/microstrategy-api-node.svg?style=shield)](https://circleci.com/gh/tiagosiebler/microstrategy-api-node)\n[![CodeFactor](https://www.codefactor.io/repository/github/tiagosiebler/microstrategy-api-node/badge)](https://www.codefactor.io/repository/github/tiagosiebler/microstrategy-api-node)\n\nA light Node.js SDK for the MicroStrategy REST and Task APIs.\n\n## Dependencies\nHTTP requests are handled by [axios](https://www.npmjs.com/package/axios), the promise based HTTP client for the browser and node.js.\n\n## Installation\n### Node Environments\n#### npm\n```\nnpm i microstrategy --save\n```\n\n#### yarn\n```\nyarn add microstrategy\n```\n\n### HTML Pages\nThis module can be used on any HTML page using the bundled `dist/mstrapi.min.js` file. Simply include this script tag on any page:\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/microstrategy/dist/mstrapi.min.js\" crossorigin=\"anonymous\"\u003e\u003c/script\u003e\n```\nSee [./webpack](./webpack) for documentation on the bundling process.\n\nOnce loaded via the script tag, this API module can be accessed via a global object called `mstrapi`:\n```javascript\n    const baseUrl = 'http://aps-tsiebler-vm:8080/2020u1Library/api';\n    const mstrClient = new mstrapi.REST({\n      baseUrl: baseUrl\n    });\n```\n\nSee [./samples/html/cdn-login.html](./samples/html/cdn-login.html) for an example.\n\n## MicroStrategy REST API\n- Import the module and create a new instance of the REST client.\n- Provide a URL to your MicroStrategy Library REST API via the baseUrl parameter.\n- Login \u0026 Logout methods are exposed on the REST client. Other methods are grouped by topic.\n- Every REST method returns a Promise, making this library [async await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) ready.\n- By default, your session state headers are stored and persisted by your client instance.\n\n```javascript\nconst mstr = require('microstrategy');\n\n(async () =\u003e {\n  const baseUrl = 'http://aps-tsiebler-vm:8080/2020u1Library/api';\n  const mstrClient = new mstr.REST({\n    baseUrl: baseUrl\n  });\n\n  await mstrClient.login({\n    username: 'Administrator',\n    password: '',\n    loginMode: 1\n  });\n\n  // MicroStrategy Tutorial\n  const projectId = 'B19DEDCC11D4E0EFC000EB9495D0F44F';\n  mstrClient.setProjectId(projectId);\n\n  const dossierId = 'C103CFA847057FC9FCF772ADF9092BD9';\n\n  // APIs are grouped by topic\n  const DossierAPI = mstrClient.dossiersAndDocuments;\n  const dossierDefn = await DossierAPI.getDossierDefinition(dossierId);\n})();\n```\n\n### REST API Documentation\nThese methods are simpler wrappers around the APIs exposed by the MicroStrategy Library REST API server. For full documentation, refer to your MicroStrategy Library's `api-docs` endpoint.\n\nFor example, if your MicroStrategy Library environment has the following URL:\n```\nhttp://example.com/MicroStrategyLibrary/\n```\n\nYour API documentation can be found here:\n```\nhttp://example.com/MicroStrategyLibrary/api-docs\n```\n\nFor public REST API documentation from the MicroStrategy demo environment, refer to the following URL:\nhttps://demo.microstrategy.com/MicroStrategyLibrary/api-docs\n\n### More REST API Samples\nRefer to the [samples](./samples/) folder for more samples tested in node.js. These can be directly executed using the node command:\n```bash\nnode samples/getDossier.js\n```\n\n### Missing REST APIs\nIf you notice any missing endpoints, please contribute with a PR to enhance this module.\n\n## MicroStrategy Task API\nThis module includes a minimal wrapper to execute tasks via the Task API.\n\n- Import the module and create a new instance of the TaskAPI client.\n- Provide a URL to your MicroStrategy Web taskProc via the taskProcUrl parameter.\n- Build a request via the `executeTask()` method.\n\n\n```javascript\nconst mstr = require('microstrategy');\n\n(async () =\u003e {\n  const taskApi = new mstr.TaskAPI({\n    taskProcUrl: 'http://aps-tsiebler-vm:8080/2020u1/servlet/taskProc'\n  });\n\n  const taskId = 'login';\n\n  // Collect these from the task builder page\n  const taskParameters = {\n    server: 'aps-tsiebler-vm',\n    project: 'MicroStrategy Tutorial',\n    userid: 'administrator',\n    password: ''\n  };\n\n  // The response includes { body, headers, status, statusText }\n  try {\n    const res = await taskApi.executeTask(taskId, taskParameters);\n    console.log('task response: ', res.body);\n  } catch (e) {\n    console.error(e);\n  }\n})();\n```\n\n[1]: https://www.npmjs.com/package/microstrategy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagosiebler%2Fmicrostrategy-api-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiagosiebler%2Fmicrostrategy-api-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiagosiebler%2Fmicrostrategy-api-node/lists"}