Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

Authorization error in IOT service API

$
0
0

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:

 

HCP IOT cockpit test screen.png           

HCP IOT cockpit test reply.png

 


But when, I tried to send messages using google postmen client with below settings, I got authorization error.

   

URL: https://iotmmsi072166trial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/2681b140-2059-4c5a-bbd2-b0d5b1ec9065

   

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:

       

pstman.png

   

postman error.png

Thanks,

Mukesh


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>