cancel
Showing results for 
Search instead for 
Did you mean: 

HCP IoT Push service via Postman not working

pfau_patrick
Explorer
0 Kudos

Dear Community,

when using the MMS to push data via http to a device, everything works as expected.

Trying the same using Postman fails with a 403 error.

Can you please assist?

This is  the url:

https://iotmms<XX_MY_ACCOUNT_XX>.hana.ondemand.com/com.sap.iotservices.mms/v1/api/http/push/430d338f...

The device id is the id of my receiving device

Header is set with OAUTH-token:

Body:

{"method":"http", "sender":"My IoT application", "messageType":"9eeeb7d990e1dc2XXXXX","messages":[{"sensor":"My Sensor 1","value":"m,y Value 3", "timestamp":1413191658}]}

The url looks exactly the same compared to the one MMS is generating.

Thanks in advance,

Patrick

Accepted Solutions (1)

Accepted Solutions (1)

anton_levin
Advisor
Advisor
0 Kudos

Hi Patrick,

did I get it right that you are on productive landscape and not on HCP Trial?

Regards,

Anton

pfau_patrick
Explorer
0 Kudos

Hi Anton,

we are SAP-Partner and have a HCP-account via PartnerEdge-program. So yes, we are not on trial..

Best regards

Patrick

anton_levin
Advisor
Advisor
0 Kudos

Ok, I see. To me the URL and payload look fine. Seems like Postman reuses the existing session from your browser (where you have been authenticated with SAML when you accessed MMS Cockpit, for example or HCP Cockpit). So, close all browser windows (to have clean session), launch Postman again and make a HTTP request towards Push API.

Let me know if that helped. If not, w'd need to have a closer look.

Regards,

Anton

pfau_patrick
Explorer
0 Kudos

same result..

Receiving pushed data is working fine via Postman with this URL and Header correctly set:

https://iotmms<XX_MY_ACCOUNT_XX>.hana.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/430d338f...

Strange..

ravi_teja14
Participant
0 Kudos

Hi Patrick,

Could you please try by using the mode as synchronous in the payload. Select the message type in the Body Tab as "raw"  and "JSON(application/json)"

{

  "mode":"sync",

  "messageType":"",

  "messages":[

   {"",""}

   ]

}

Regards,

Teja.

pfau_patrick
Explorer
0 Kudos

Hi Teja,

thanks, but did not change anything..

Best regards,

Patrick

anton_levin
Advisor
Advisor
0 Kudos

Are you using the token which you got for your device? If yes, this is wrong.

Push API is protected with Basic and OAuth but for OAuth you have to generate a token yourself (with push scope). See SAP HANA Cloud Platform Internet of Things (IoT) Services

Regards,

Anton

pfau_patrick
Explorer
0 Kudos

Thanks Anton,

that did the trick, it is working!

I forgot to set the push scope for my OAUTH client..

All the best,

Patrick

Answers (1)

Answers (1)

pfau_patrick
Explorer
0 Kudos

One more thing:

just tested the same in a JAVA-program, same result.

So does not seem to be related to Postman..

Best regards

Patrick

ravi_teja14
Participant
0 Kudos

Hi Patrick,

Try to test by push the messages within the IoT in the push messages tab. we can confirm wether data is updating in the database tables or not.

please check the connectivity/authorizations to receive the messages from external tools or the systems.

Regards,

Teja.