2 Replies Latest reply on Feb 8, 2016 6:36 PM by user_1234

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

    user_1234

      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>

      <html lang="en" ng-app="iotAppLogin">

          <head>

              <meta charset="utf-8" />

              <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

              <title>IoT Analytics Dashboard</title>

              <link rel="icon" type="image/png" href="static/favicon.png">

              <meta http-equiv="x-ua-compatible" content="IE=9; IE=8; IE=Edge; chrome=1" >

              <meta name="viewport" content="width=device-width, user-scalable=0"/>

              <link rel="stylesheet" href="static/css/external-bootstrap.aa594a54.css"/>

              <link type="text/css" rel="stylesheet" href="static/lib/jquery-entropizer-lib/jquery-entropizer.min.css" />

              <link rel="stylesheet" href="static/generated/css/iotkit-index.0300c60a.css"/>

              <script src="static/generated/js/external-index.e29423f0.js"></script>

              <script src="static/generated/js/iotkit-index.727f0634.js"></script>

              <script type="text/javascript" src="//www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>

              <script src="static/lib/recaptcha/angular-recaptcha.min.js"></script>

          </head>

          <body class="no-buttons" style="display: block;" ng-if="appReady">

              <nav class="navbar navbar-default" role="navigation">

                  <div class="menu-nav">

                      <h1 type="button" class="logo"></h1>

                      <span class="title">{{i18n.app_title}}

                          <span class="label label-primary ">BETA</span>

                      </span> 

             

                  </div>

         

              </nav>

              <div class="container">

                  <div ng-view></div>

         

              </div>

          </body>

      </html>


      For the request i followed the instructions found here: 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/<device ID in format AA-BB-CC-DD-EE-FF-11> HTTP/1.1

      Host: dashboard.us.enableiot.com

      Content-Type: application/json

      Authorization: Bearer <the authorization token i got: eyJ0...>

      Cache-Control: no-cache

      Postman-Token: <must be created by postman, format 4ee567-5677-...>

       

      {

          "on": 1354741967799,

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

          "data": [           

              {

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

                  "on": 1354741966688,

                  "value": "35"

              }

            

          ]  

      }

       

      I would be very grateful for any ideas on what i might be doing wrong or what I am forgetting here.

       

      Regards

      Julia