Community
cancel
Showing results for 
Search instead for 
Did you mean: 
JFaul1
Novice
1,128 Views

Intel Analytics REST API returns HTML login page instead of JSON data

Hi,

I am trying to test the REST API with Postman. Receiving the authorization token works fine, but if I want to sent or receive data from the cloud I get 200 status code and the HTML of the dashboard.enableiot.com login page:

<!DOCTYPE html>

IoT Analytics Dashboard

{{i18n.app_title}}

BETA

 

For the request i followed the instructions found here: https://github.com/enableiot/iotkit-api/wiki/Data-API Data API · enableiot/iotkit-api Wiki · GitHub

My request to send data looks like this, all the IDs (account, device, component) are changed to the IDs I found on the dashboard website:

POST /data/ HTTP/1.1

Host: dashboard.us.enableiot.com

Content-Type: application/json

Authorization: Bearer

Cache-Control: no-cache

Postman-Token:

{

"on": 1354741967799,

"accountId": "550e8400-e29b-41d4-a716-446655440000>",

"data": [

{

"componentId": "436e7e74-6771-4898-9057-26932f5eb7e1>",

"on": 1354741966688,

"value": "3...

Tags (1)
2 Replies
Sergio_A_Intel
Employee
105 Views

Hi user_1234,

Before sending data make sure you have already followed https://github.com/enableiot/iotkit-agent GitHub - enableiot/iotkit-agent: Edge agent to abstract cloud connectivity complexities . Make sure you are using the latest version as well.

Have you already checked the Connecting to IoT Analytics via REST API section and the sample codes available for Python and JavaScript? See more here: https://software.intel.com/en-us/intel-iot-platforms-getting-started-cloud-analytics Intel® IoT Platforms: Getting Started: Cloud Analytics | Intel® Developer Zone

I also found a similar thread to yours. Look at

Sergio

JFaul1
Novice
105 Views

Hi Sergio,

Thanks a lot for your help. The python code helped, as I realized after going through the code that my URL was simply missing "/v1/api". It has to be:

https://dashboard.us.enableiot https://dashboard.us.enableiot/v1/api/data/

In my opinion this is not very obviously stated in the API documentation on Github, as the /v1/api part is added in the Doku in the REST url to get the token but not for the Data API.

Thank you.

Julia

 

Reply