cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve data - poll from HCP

Former Member
0 Kudos

Hi,

I am trying to simulate the device reading data pushed from HCP to device. As per GitHub iot-starter kit I found the URL mentioned is

https://iotmms_on_your_trial_system.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/...

When I run this URL in browser and pass Authorization header as device OAuth Token generate from IoT Cockpit. It doest not return me any response. Also I check the documentation for IoT and there a different URL was mentioned

https://<host>/com.sap.iotservices.mms/v1/api/http/app.svc/

Is there any change to the APIs ?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

anton_levin
Active Contributor
0 Kudos

Hi Mayank,

can you please elaborate again what you try to achieve?

1. Device send messages to HCP and you want to consume those messages in your business application

or

2. HCP sends messages to Device and you want to receive those messages on a Device side

URL you have mentioned are exactly for those tho different use cases.


For case 1. is https://<host>/com.sap.iotservices.mms/v1/api/http/app.svc/<table name>

For case 2. is https://<host>/com.sap.iotservices.mms/v1/api/http/data/<device id>

Regards,

Anton

Former Member
0 Kudos

HI Anton,

Its case 2 .

I am able to PUSH message and see those message in T_IOT_HTTP_PUSH table in IoT.

Next step is to read those message on device side for which I try to run case 2 url in Postman and it returns nothing.

Am I doing something wrong here ?

Regards,

Mayank

Former Member
0 Kudos

Got it working now. Some issue at my end.

Thanks anyway for your help Anton.

anton_levin
Active Contributor
0 Kudos

Another clarification. Do you get an empty response or empty json array back?

Maybe, you can share some screenshots of the PUSH table (where device id is visible) and also share your URL com.sap.iotservices.mms/v1/api/http/data/<device id>

so that we can compare the IDs? Which HTTP headers you supply in Postman? Also, be aware that Postman may re-use your current browser session (where you are logged in with SAML already). In this case an Authorization header wiht device token will not have an effect. It is recommended to close all browser windows, re-launc Postman and fire the HTTP call.

Regards,

Anton

anton_levin
Active Contributor
0 Kudos

Nice. Maybe you can still share your solution please, so that the next reader have an answer?

Former Member
0 Kudos

Yes there was probably problem with browser session as I was getting empty response. I happened to try it in a fresh session to see the json array as you stated below.

Thanks,

Mayank

Answers (0)