Navigation

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

    aasiph

    @aasiph

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

    aasiph Unfollow Follow

    Latest posts made by aasiph

    • Smart API only working on Terminal. No where else?

      Creating a index.js file with code below and running it with command node index.js on terminal works perfectly. I get the jwtToken and holding details using that jwtToken.

      async function fetchData() {
        
        var data = JSON.stringify({
          clientcode: "MyClientCode",
          password: "MyPassword",
          totp: "123456",
        });
      
        const loginResponse = await fetch("https://apiconnect.angelone.in/rest/auth/angelbroking/user/v1/loginByPassword", {
          method: "POST",
          headers: {
            Accept: "application/json",
            "Content-Type": "application/json",
            "X-ClientLocalIP": "",
            "X-ClientPublicIP": "",
            "X-MACAddress": "",
            "X-UserType": "USER",
            "X-SourceID": "WEB",
            "X-PrivateKey": "myApiKey",
          },
          body: data,
        });
      
        const loginResponseData = await loginResponse.json();
        
        console.log("Got Response:", loginResponseData);
      
        if (loginResponseData.status === true) {
          jwtToken = loginResponseData.data.jwtToken;
          const holdingResponse = await fetch("https://apiconnect.angelone.in/rest/secure/angelbroking/portfolio/v1/getHolding", {
            method: "GET",
            headers: {
              Accept: "application/json",
              "Content-Type": "application/json",
              "X-ClientLocalIP": "",
              "X-ClientPublicIP": "",
              "X-MACAddress": "",
              "X-UserType": "USER",
              "X-SourceID": "WEB",
              "X-PrivateKey": "myApiKey",
              "Authorization": `Bearer ${jwtToken}`,
            },
          });
          const holdingResponseData = await holdingResponse.json();
          console.log("Got Holding:", holdingResponse.data);
        } else {
          console.log("Login Error");
        }
      }
      
      fetchData();
      

      But the same code does not work on any web framework backend. I tried using Express and NUXT which are based on node.js.
      Infact i tried in different languages like php, c#, flutter but all fail in login endpoint giving response

      {
        success: false,
        message: 'Invalid Token',
        errorCode: 'AG8001',
        data: ''
      }
      

      I am not sure what is the issue. Please any solution for this.

      posted in NodeJS SDK
      A
      aasiph
    • RE: API key restriction

      Hi @admin the accounts which i mentioned above, i am still not able to login with api. I think so they are not yet migrated. Please do it and also please send me an invite or download link for tradeNXT at thatsasif@hotmail.com

      posted in General Discussion
      A
      aasiph
    • RE: API key restriction

      Hi @admin I see that TradeNXT is not available for download as it is in beta phase. I would like to test it if its possible.

      posted in General Discussion
      A
      aasiph
    • RE: API key restriction

      Hello @admin
      Please migrate both these id's S23020 and T9803.
      We dont use speed pro. By the way i want to know if we wont be able to access the speed pro app then is Angel Broking planning to bring in some new desktop app.

      posted in General Discussion
      A
      aasiph
    • RE: API key restriction

      @admin
      No i cant login for client ID.. S23020 and T9803.

      If anybody trusts and is interested can try at https://aiglemedia.com/itrade/
      Only portfolio and funds status is coded for now.
      I am just trying to build app with vuejs.

      posted in General Discussion
      A
      aasiph
    • RE: API key restriction

      Is it like only migrated clients are able to login using API?

      posted in General Discussion
      A
      aasiph
    • API key restriction

      Hi,
      I want to know whether the API key is restricted to a particular client.
      I am asking because i can successfully login with my personal account but when i try to login with my dads account or my friends account it gives Invalid Token error.

      User loggedout
      {
        success: false,
        message: 'Invalid Token',
        errorCode: 'AG8001',
        data: ''
      }
      
      posted in General Discussion
      A
      aasiph