Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    SmartAPI - PHP Client SDK getting only time feed

    General Discussion
    0
    2
    19
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      skylight last edited by

      Hello, @admin ,@administrators . I have integrated php sdk and I am getting only time feed. Please help me to get market watch. Thankyou

      in the below I am putting my php code

      <script src="vendor/smartapi-php/angelbroking/src/socket.js"></script>

      <?php

      require_once DIR . '/vendor/autoload.php';
      $smart_api = new \AngelBroking\SmartApi();
      $login = $smart_api ->GenerateSession("G287101","########");
      echo $login;
      //$token = $smart_api ->GenerateToken();

      $JSONOUT=json_decode($login, true);
      //print_r($JSONOUT["response_data"]["data"]["feedToken"]);
      $feedToken=$JSONOUT["response_data"]["data"]["feedToken"];
      ?>

      <script type="text/javascript">
      console.log('<?php echo $feedToken; ?>');
      var ws =new websocket('G287101', '<?php echo $feedToken; ?>');
      ws.connection().then(() => {
      ws.runScript("mcx_fo|230455", "mw");
      setTimeout(function () {
      ws.close()
      }, 6000)
      });
      ws.on('tick', receiveTick);
      function receiveTick(data) {
      console.log(data);
      }
      </script>

      Output of the above code

      {"status":"success","http_code":200,"http_error":"","response_data":{"status":true,"message":"SUCCESS","errorcode":"","data":{"I am receiving the jwttoken, refershtoken and feedtoken"}

      please help

      M 1 Reply Last reply Reply Quote 0
      • M
        Moderator_2 @skylight last edited by

        Hi @skylight

        Apologies for delayed response.
        We are currently supporting the JAVA, Javascript and python SDK as of now. Please consume the recent SDKs and let us know if the issue still occurs

        Thanks & Regards,
        SmartAPI team

        1 Reply Last reply Reply Quote 0
        • First post
          Last post