Hi,
I am trying to use HCP IOT services from my HCP trial account and facing authorization issue.
Scenario:
I have created Message type , device and generated access token using Internet of Things Services Cockpit.
Device Id : 2681b140-2059-4c5a-bbd2-b0d5b1ec9065
Generated OAuth access token: <generated token id>
Message type ID: 0050558a0e149633b238
I posted the messages using message management section of Internet of Things Services Cockpit with below settings and it worked fine.
HTTP endpoint: https://iotmmsi072166trial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/2681b140-2059-4c5a-bbd2-b0d5b1ec9065
Message to post: {"mode":"sync","messageType":"0050558a0e149633b238","messages":[{"PowerConsumed":27,"timestamp":1413191650}]}
HCP IOT cockpit test screen shots:
But when, I tried to send messages using google postmen client with below settings, I got authorization error.
Method: POST
Header Parameters:
Authorization: Bearer <access token generated from device>
Message body raw:
{"mode":"sync","messageType":"0050558a0e149633b238","messages":[{"PowerConsumed":27,"timestamp":1413191650}]}
Google postman screen shots:
Thanks,
Mukesh