Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. amanthuniya94
    A
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    amanthuniya94

    @amanthuniya94

    0
    Reputation
    5
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    amanthuniya94 Follow

    Best posts made by amanthuniya94

    This user hasn't posted anything yet.

    Latest posts made by amanthuniya94

    • Login issue PHP curl

      I am trying to login but it keep on giving me error code 400. Not sure why? Below is my code
      Also in header I am not sure what to set as MAC IP as I don't hold mac and in client local ip I am adding my system local IP and in client public ip I am adding my server ip where my website is located.
      I hope i am doing it right..

      $headers = array('Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientLocalIP: 182.69.96.96', 'X-ClientPublicIP: 185.28.21.157', 'X-MACAddress: MYMACIP', 'X-PrivateKey: MYPRIVATEKEY');

          $data["clientcode"] = "MYCLIENTCODE";
          $data["password"] = "PASSWORD";
      
          $url = 'https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword';
      
          $jsonData = json_encode($data);
      
          $curl = curl_init();
          curl_setopt($curl, CURLOPT_POST, 1);
          curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
          curl_setopt($curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
          curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
      
          curl_setopt($curl, CURLOPT_URL, $url);
          curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
              
          $result = curl_exec($curl);
          $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
      
          echo '<br/>Response Status : ' . $http_status;
          echo '<br/>Response String : ' . $result;
      
          //To Convert json response to array
          $resJsonArray = json_decode($result, true);
      

      Response I am receiving is

      Response Status : 400
      Response String :

      posted in General Discussion
      A
      amanthuniya94
    • PHP LTP API

      Hey
      I am using smart API in the PHP platform
      Everything is okay but I am a little lost to identify which API should I call to get the live trading data of NFO (Only for NFO)
      There is not much written in the documentation.
      Can you help me?
      May be it is something related to LTP but I am not sure how to call it through PHP

      Thank you in advance!

      posted in General Discussion
      A
      amanthuniya94
    • RE: Login issues

      @admin
      Thank you for the response.
      Yes I am going through this documentation and I have done exactly what API asks from me but eventually I am not getting any response and getting response from API "1" nothing else

      posted in Bugs
      A
      amanthuniya94
    • Login issues

      I am having login issues. In output I keep on receiving "1" and nothing else. I am not sure if I am doing anything wrong or I need to call API in different method. I have tried using below API via postman and receiving "1" as output. Further details are mentioned below.

      API - https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword

      Headers I am sending

      1. Content-Type = application/json
      2. Accept = application/json
      3. X-PrivateKey = My API key

      In post I am sending

      1. clientcode - MY CLIENT CODE
      2. password - My Password

      Please help me I am stuck

      posted in Bugs
      A
      amanthuniya94