Cancel
Showing results for 
Search instead for 
Did you mean: 

Calling the API with cron job

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

Hello,

 

how can I reach the MindSphere API directly from my application, without making a call with an user?

 

Is it possible to access for example the list of customers on a regular basis with a cron job?

 

11 REPLIES

Re: Calling the API with cron job

Community Manager Community Manager
Community Manager
Hi @Henning22,

to do that, you will need a "Technical User". There is an entry in the API reference how to create a technical user as a developer through the API. The technical user can then perform interactions with the system, such as API calls, without an actual person executing them, for example, background processes without being logged in.

If you are having troubles creating such a technical user, our development support will be able to assist you with it.

Re: Calling the API with cron job

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

Hi @dvidflrmnd,

 

thank you for your reply. Are there any examples of how to use the technical user inside the application? I was able to create an "secret" for the application, but I do not know how to continue.

 

Thank you.

Re: Calling the API with cron job

Siemens Creator Siemens Creator
Siemens Creator

Hi

@Henning22, Can you please explain the steps you solved so far or at least refer to a document describing how to get the secret.

@dvidflrmnd, What is the tenant context of a technical user? 
Is a technical user related to a specific T1/T2 Tenant?

 

Thx,

Christian

Re: Calling the API with cron job

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

@koch4MSP I got the Secret Token from the Application Registry API. I was not able to find a documentation but you can see the Swagger data here: http://<tenant>.appsdev.mindsphere.io/applicationregistry/

 

The call to get the token is: 

https://<tenant>.appsdev.mindsphere.io/applicationregistry/api/applications/<applicationID>/secret

 

Re: Calling the API with cron job

Pioneer
Pioneer
Hi @dvidflrmnd,

Can you tell me where I can find API reference document? Thanks in advance

Re: Calling the API with cron job

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Hi @vnsuper

 

there is this document, called "MindSphere API Reference for Application Developers". It is available on SIOS at https://support.industry.siemens.com/cs/document/109744875/mindaccess-developer-tutorials?dti=0&pnid...

 

But this SIOS thing is a little bit tricky Smiley Happy In case to access this section you need:

a) to be registered there

b) your account there should be activated as a MindSphere developer account (only registered developers can access the dev docs). If you have access to a MindSphere developer plan/tenant but your account is not activated as developer at SIOS, then please contact the MindSphere support.

c) make sure that you selected either "Intranet + Extranet" or "MindSphere" network in the top right corner of the page (see two pics below).

 

SIOS_1.jpgSIOS_2.jpg 

Re: Calling the API with cron job

Creator
Creator

@Henning22

 

https://<tenant>.appsdev.mindsphere.io/applicationregistry/api/applications/<applicationID>/secret

wich applicationID do you mean ? 

how can get the applicationID ?

 

I have to finish the programming of the app !!  and after registration i will get the secret (token) ??

 

thanks

Re: Calling the API with cron job

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

@dboucher

 

After you registered your app with the Application Manager you can get all your registered applications (with ids) by calling this URL: 

 

https://<tenant>.appsdev.mindsphere.io/applicationregistry/api/applications?size=10&page=0

Re: Calling the API with cron job

Creator
Creator

@Henning22  any success on cron job? i also have the same problem i wanted to store some Aggregated values to backing services i.e mongoDB.