Navigation

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

    RS

    @RS

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

    RS Follow

    Best posts made by RS

    This user hasn't posted anything yet.

    Latest posts made by RS

    • Getting Error on Smart API generateSession (Node JS)

      import { totp } from 'otplib';
      import dotenv from 'dotenv';
      dotenv.config();

      const getTOTP = () => {
      try {
      const otp = totp.generate(ANGEL_ONE_TOTP_KEY);
      return otp;
      } catch (err) {
      console.log(err)
      }
      }

      const startWebSocketConnection = async () => {

      try {
          smartApi
              .generateSession(process.env.ANGEL_ONE_CLIENT_ID, process.env.ANGEL_ONE_CLIENT_SECRET, getTOTP())
              .then((data) => {
                  console.log(data);
                  return smartApi.getProfile();
              })
              .then((data) => {
                  console.log(JSON.stringify(data, null, 2));
              })
              .catch((error) => {
                  console.log(error);
              });
          
      } catch (err) {
          console.log(err)
      
      }
      

      };
      // _currentUrl: 'https://apiconnect.angelone.in/user_login'
      /* Getting the Following Error
      "<html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br><br>Your support ID is: 13563063868471547593<br><br><a href='javascript:history.back();'>[Go Back]</a></body></html>" */

      posted in Bugs
      R
      RS