About Data as a Service
What is Data as a Service?
Data as a Service, short DaaS, describes the possibility of automatically controlling the functions of EcoStruxure Machine Advisor, which are normally operated by the user via the graphical user interface via scripts.
Machine Advisor exposes an API that enables devices to send data securely and reliably to Machine Advisor in order to control different methods on Machine Advisor.
What are the benefits of DaaS?
The DaaS model allows seamless access to the Machine Advisor Service API, which can help to minimize setup time by immediately storing and processing of data using DaaS. DaaS improves functionality, offers greater flexibility, provides access to the Cloud infrastructure, and makes the ability to automate updates and maintenance of the service available.
What is GraphQL?
GraphQL is a query language for APIs and a runtime for fulfilling those queries. GraphQL gives you the power to ask for exactly what they need and nothing more. While REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request.
A GraphQL operation can either be a read or a write operation. A GraphQL query is used to read or fetch values while a mutation is used to write or post values. In either case, the operation is a simple String that a GraphQL server can parse and respond to with data in a specific format.
Data as a Service on Machine Advisor
How does Data as a Service work on Machine Advisor?
The access to endpoint on the Machine Advisor GraphQL Server is protected by Personal Access Token (Bearer Token). You can apply for a Token on your Machine Advisor user profile page. The request needs to be approved by Digital Champion.
First, click on your profile on the top right to enter the “Manage My Profile” page. From your profile page, go to the “Access Token” tab. Click on the button “APPLY BETA ACCESS” and fill in the pop-up window to register for access.
How can I manage my Access Token and the Playground for access to Machine Advisor’s API?
KEEP ACCESS TOKENS SAFE
Please note that the Personal Access Token should be treated like an account password and not be exposed/ accessible to other persons, as it can have the same access rights as the corresponding user account.
Delete unused tokens, restrict your token to read only (if possible) and assign it to an organization, while keeping it secret.
First, click on your profile on the top right of any Machine Advisor’s page to enter the “Manage My Profile” page.
From your profile page, go to the “Access Token” tab.
On this page, you can manage your Access Token as well as enter the Playground for access to Machine Advisor’s API.
To have access, you need a personal token, which you can create from the “Add New Token” button.
You will be prompted to name your Token and select whether you want this Token to have Read-Only accessibility. A Token with Read-Only capability won’t be able to perform mutations and can only query with Machine Advisor’s API. Once everything is selected, click “Create” to generate the Token.
Once the Token has been generated, you should save the access Token in a secure location as Machine Advisor will not store it, and you won’t be able to see it again. This Token will be used to access the Machine Advisor API.
Go to “Open Playground” to access the Machine Advisor API.
Use the personal access Token you have received to access the API.
This will bring you to the main page of the Playground where you can access Machine Advisor’s GraphQL, depending on the accessibility your Token provided. For more information, there is a documentation on the top right under “<Doc” to search about various Machine Advisor’s GraphQL Schemas.
In the Documentation Explorer, you can simply search for the Schemas or to access the root types and see each kind of operation available. Query allows users to read data from Machine Advisor while Mutation provides data manipulation capabilities.
How can I get back my “Personal Access Token”?
Unfortunately, it is impossible to retrieve back your lost Personal Access Token. The tokens are not store in clear text to our database. They are transformed with a cryptographic hash function (SHA512) into a text and can’t be reverted back to clear text token. It can only be used to validate the token against the hashed value when you raised a request against our server. This is done due to cybersecurity reasons.
The solution would be to delete the old access token, add a new Access Token and store it securely.
How can I reset my “Personal Access Token”?
You can have up to a maximum of five Tokens in parallel. You can reset a Token by clicking on the trashcan icon. To revoke every Token at the same time, you can use the “Revoke All” button. The Token will immediately become invalid after revoking.
Machine Advisor’s API via POSTMAN
What is POSTMAN?
Postman is a collaboration platform for API development. You can use Postman to design, build, and test APIs.
How can I access Machine Advisor’s API via POSTMAN?
It is possible to access the Machine Advisor API by using POST to the Machine Advisor Cloud using POSTMAN. Since Machine Advisor utilizes GraphQL, you can use POSTMAN to send in GraphQL queries to Machine Advisor.
Below are examples of Snippets that use the Machine Advisor API, including multiple requests for creating a new Machine on Machine Advisor.
These Snippets allow you to create a New Machine on Machine Advisor by specifying and then sending the request for GraphQL mutation or read the information via GraphQL query. If everything is configured correctly, it’s possible to complete the entire Machine creation procedure as well as creating the Dashboard and Widget with one POST request to Machine Advisor.
Machine Advisor’s API via Power BI
What is Power BI?
Power BI is a service provided by Microsoft that allows data visualization and provides a simple interface for users to create reports and dashboards for business analytics.
How can I use Power BI with Machine Advisor?
Power BI is one of many tools that can use the Machine Advisor API and send query requests to Machine Advisor to create reports or dashboards.
In this example, Power BI is used to query data from a Machine on Machine Advisor and then formatted into a report.
In Power BI, you can create Query requests to the Machine Advisor API and retrieve data. The example queries below are demonstrating User logging in to get the Machine data first and then the available variables.
Each query can be edited to specify the requests. An Access Token is required to access the Machine Advisor API, as shown in the example below. This example query will return the user’s login id and name.
If the query syntax is configured correctly, you will obtain the data requested by each query. In the example below, a query was made to get the Values over the last 12 months”, with on the right the data response of the query.
After completion, all the data from Machine Advisor is at your disposal, and depending on the tools you use, dashboards or reports can be produced with the acquired Data.
With Power BI, you can create a dashboard simply by dragging and dropping the visualization options, as shown in the image below on the right, and then simply use the data retrieved from the query and put it into the dashboard.