Navigation

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

    Invalid token error code AG8001 in java

    NodeJS SDK
    2
    2
    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.
    • R
      rohya.tayade last edited by rohya.tayade

      body = RequestBody.create(mediaType, "{\n"exchange": "NSE",\n"tradingsymbol": "SBIN-EQ",\n"symboltoken":"3045"\n }");
      request = new Request.Builder().url("https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getLtpData")
      .method("POST", body)
      .addHeader("Authorization", jwtToken)
      .addHeader("Content-Type", "application/json")
      .addHeader("Accept", "application/json")
      .addHeader("X-UserType", "USER")
      .addHeader("X-SourceID", "WEB")
      .addHeader("X-ClientLocalIP", "CLIENT_LOCAL_IP")
      .addHeader("X-ClientPublicIP", "CLIENT_PUBLIC_IP")
      .addHeader("X-MACAddress", "MAC_ADDRESS")
      .addHeader("X-PrivateKey", "XkadWegsNH6H")
      .build();
      try {
      Response response = client.newCall(request).execute();
      jsonReader = new JsonReader(response);
      String json = jsonReader.getJsonString();
      token.setText(json);
      } catch (IOException e) {
      e.printStackTrace();
      }

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @rohya.tayade last edited by

        Hi @rohya-tayade Are you able to generate session.

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