public static void testClient(String userId) { // HttpHeaders HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(new MediaType[] { MediaType.APPLICATION_XML })); // Request to return XML format headers.setContentType(MediaType.APPLICATION_XML); // headers.set("my_other_key", "my_other_value");
// HttpEntity: To get result as Employee[]. HttpEntity entity = new HttpEntity(headers);
// RestTemplate RestTemplate restTemplate = new RestTemplate();
// Send request with GET method, and Headers. ResponseEntity response = restTemplate.exchange(URL_PROPERTIES, HttpMethod.GET, entity, String[].class);
@sujith thanks for your response, yes I agree once in a day i need to do login but whenever I am trying to execute order program is throwing Invalid Token exception,
So as per my understanding below are the steps I need to follow.
Step 1: Login to https://kite.trade/connect/login?v=3&api_key=XXX and comple authentication process and acquire the request token and persist in DB or file or in memory. Question: Can I use same saved request token and access_token which I got it after generateSession method invoke or Every time manually I need to copy paste above URL and get request token and manually follow the same steps?
I am sorry if I am trying to ask stupid question but my plan is to make full process automated except once login and get the request token and use the same token all trading day.
Do u have any REST client example to invoke?
So as per my understanding below are the steps I need to follow.
Step 1: Login to https://kite.trade/connect/login?v=3&api_key=XXX and comple authentication process and acquire the request token and persist in DB or file or in memory.
Question: Can I use same saved request token and access_token which I got it after generateSession method invoke or Every time manually I need to copy paste above URL and get request token and manually follow the same steps?
Even if I need new request token all the time when I run my program can I use curl to invoke https://kite.trade/connect/login?v=3&api_key=XXX this url to get the request_token
I am sorry if I am trying to ask stupid question but my plan is to make full process automated except once login and get the request token and use the same token all trading day.