Cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Mindsphere API from backend scheduler

Experimenter
Experimenter

We have a cron scheduler running inside the Mindsphere application to ingest the data into the Mindsphere platform. we have gone through "Calling APIs from Backend" section in the below link, but it is different from "calling APIs from background scheduler in a Mindsphere app". As our usecase is different,  can you point me the procedure to consume the Mindsphere API from a scheduler?.

 

https://developer.mindsphere.io/concepts/concept-authentication.html

 

Thanks.

4 REPLIES 4

Re: Accessing Mindsphere API from backend scheduler

Legend
Legend
Since this is server to server communication, it is a good use case for the technical user credentials. You can provision your backend with access to them on startup and your cron job will be able to communicate with the MindSphere APIs. It's the same use case as a self-hosted app:
https://developer.mindsphere.io/howto/howto-selfhosted-api-access.html

You have a sample of this in the devops-demo project:
https://gitlab.com/mindsphere/devops-demo/blob/master/devops/devopsadmin/services/notification.js

Re: Accessing Mindsphere API from backend scheduler

Experimenter
Experimenter

Dlouzan, Thanks for the direction. Following are my understandings from the document, kindly correct me if I am wrong

1. Since the service credentials are tenant specific, the operator has to request the 'service credential' for every tenant/customer via mail?.

2. The service credentials has to be renewed for every tenant manually, which is again a manual process?.

Re: Accessing Mindsphere API from backend scheduler

Legend
Legend

This is a use case that I myself have not (yet) tested. But if you require access to multiple tenants data, then I point you to the recently released Token Management Service API that can be used to access other tenants data:
https://developer.mindsphere.io/apis/exchange-tokenmanager/api-tokenmanager-overview.html

Until the availability of the Token Management Service API, the typical service credentials needed to be requested to MindSphere support. With the new API, your customers can create credentials directly in the developer cockpit. Check the documentation for details.

I'd be grateful for feedback if you try this approach :-)

Re: Accessing Mindsphere API from backend scheduler

Hi @svn :

 

I am also facing the same challenge and actually have a very similar setup. Using the Token Management Service as @dlouzan suggested is a great idea IF this credentials do not expire like the normal service credentials.

 

There is no information about this in the documentation, so I guess we are going to find out the hard way.