Invalid token error code AG8001 in java


  • 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();
    }


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