Skip to Content

How to make use of IoT Application Enablement REST API within own app?

Jan 18 at 12:03 PM


avatar image

I have a RaspberryPi running Node-RED. I currently have a threshold workflow deployed that reacts to specific sensor values. My question: How can I configure my client to send IoT AE Events via the REST API into my cloud instance?

I do know the syntax of the REST API to create and read events as well as the endpoint. I am able to use Postman for this job. However, the authentification using one's own client is different.

I read the Authorization Guide at the bottom of .

I also took a look at the SCP Security help page

Unfortunately, I still don't grasp the concept fully. I assume that I have to incorporate OAuth2.0 into my REST client when sending the message. But how do I that? How do I get the necessary token?

Many thanks in advance and best regards,


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Marcus Behrens
Jan 18 at 04:52 PM

The second option described here gives more details on fabian's suggestion and this works from anyplace in the Internet. You need the client secret your admin received when the tenant was provided by SAP. I would not put this client secret on a device that is deployed to the field as it allows uncontrolled access to your tenant by anybody.

Other options:

  1. wait until our ingestion can deal with events or generate events based on measurements
  2. ingest the event as "measurements" and in a batch job on the server convert it to an event object
  3. create a small node app in cf with simpler authentication and from this app create the event
  4. secure your pi so the client secret does not get into the wrong hands
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you Marcus Behrens , this blog describes exactly what I needed. My app can now create Events in my IoT AE instance!

Fabian Lehmann Jan 18 at 02:50 PM

Hi Frederik ,

to get the OAuth token you need to call the UAA from the SAP CP Cloud Foundry Environment by executing the follwing HTTP Post call:


hopefully this is what u need.



Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Fabian Lehmann ,

thank you for your help. The link you provided doesn't work for my environment. However, based on the similarity of your link, I figured out that this link is sent out via email by the SAP IoT Application Enablement onboarding team when you purchase your instance. In that email the URL was called Audience. Since I was not the one ordering the instance, I was not aware of this email. The email also contains the client_id (Client key) and the client_secret (Token service password) you then need to add to your message body.

Best regards,



Hi Frederik,

yes correct, this part of the onboarding process of the tenant.