REST stands for REpresentational State Transfer. It is web standard-based architecture and uses HTTP Protocol. TM1 REST API is a type of web service which can be used to perform create, read, update, and delete operations on TM1 objects or data. Therefore, we can maintain a TM1 model, manage TI processes, chores, dimensions and query data that is stored in the model.
TM1 REST API provides an Open Data Protocol (OData) Version 4 compliant interface to TM1 server, which allows clients to query and update data sources that are hosted by TM1 Server. The OData standard defines a set of rules and guidelines that are derived from common web technologies that include HTTP, REST, XML, and JSON. Below picture will explain how TM1 REST API works.
The request is sent from client to server in the form of web URL as HTTP GET or POST or PATCH or DELETE. After that a response comes back from server in the form of resource which can be anything like HTML, XML, JSON. But now JSON is the most popular format being used in Web Services.
Now, let’s understand various HTTP methods used in TM1 REST API. There are 4 methods commonly used in TM1 REST API which are GET, POST, PATCH and DELETE. Let’s go through each method.
Prerequisite
The prerequisite for TM1 REST API is to have basics of TM1 and Adminhost and HTTPPortNumber details of the instance which you are trying to access.
URLs for Process
It will give details of each processes available in TM1 instance if we are using GET function or accessing it through a web browser. While accessing it through web browser by default GET function is called. The output will be in Json format and can be viewed in proper structure using “http://jsonviewer.stack.hu/” URL. Let’s see the output of this URL while accessing it in a web browser.
We need to give username and password of TM1 instance in this screen.
After providing the credentials we will get output in Json format, paste the output in http://jsonviewer.stack.hu/ URL’s Text tab and then go to viewer tab. We will get output similar to below screen.
We can use same URL to transfer or post process to other TM1 instance using POST function.
It will give details of particular process whose name is specified in the URL.
URLs for Chore
It will give details of Properties of Chores (Name, Frequency, Execution mode).
Similar to process, we can use this to get details of particular chore.
We can use this to get list of process in a chore.
URLs for Dimension
It will give Details of dimension like dimension name, element name with its parent, component, type and level.
It can be used to get and post components of consolidated level elements using GET and POST function.
It can be used to get and post Attribute Name and Type of Dimension (Alias, Text, Numeric) using GET and POST function.
URLs for Cube
It will give details of each Cube like Name, Rules.
It can be used to get details of cube along with Dimension Name, Hierarchies and elements Name in Dimension.