Navigation

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

    How to generate Authorization token for Historical API?

    Bugs
    0
    4
    33
    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.
    • N
      nlptechguy last edited by

      I have login details in loginDetails field:
      const {feedToken,jwtToken,refreshToken} = loginDetails
      const historyToken = Bearer ${feedToken}
      var historyData = JSON.stringify({"exchange":"NSE","symboltoken":"3045",
      "interval":"ONE_MINUTE","fromdate":"2021-02-08 09:00",
      "todate":"2021-02-08 09:16"});

      var historyConfig = {
      method: 'post',
      url: 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/historical/v1/getCandleData',
      headers: {
      'X-PrivateKey': apiKey,
      'Accept': 'application/json, application/json',
      'X-UserType': 'USER',
      'X-SourceID': 'WEB',
      'X-ClientLocalIP': '192.168.29.100',
      'X-ClientPublicIP': '192.168.29.100',
      'X-MACAddress': 'ac:50:db:dd:78:b1',
      'Authorization': historyToken,
      'Content-Type': 'application/json'
      },
      data : historyData
      };
      I am using feedToken but getting invalid token error.

      A P 2 Replies Last reply Reply Quote 0
      • A
        anand__lunawat @nlptechguy last edited by

        @nlptechguy Did you find any solution for the above issue?

        1 Reply Last reply Reply Quote 0
        • P
          patisupa @nlptechguy last edited by

          @nlptechguy just use jwt token for all api requests. feed token is only used for websocket

          1 Reply Last reply Reply Quote 0
          • M
            Moderator_1 last edited by

            Hello @nlptechguy ,

            Apologies for the delayed response. Please use the jwt token generated in the response to login API for this purpose.If you have any other issue, please share request and response on smartapi@angelbroking.com.

            Regards
            SmartAPI Team

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