I have developed a standalone serverless android and local html app using html/js for spread trading strategies and will buy the api keys shortly. Will you be able to share any sample working html/js codes for testing purpose may be with limited access api key mainly for the initial login. I went through all the documentations but stuck with linking files. Any help is much appreciated. Also advise if it is really possible to config api for a standalone serverless desktop/mobile app only with internet access.
Stuck with the very first line below which is not working in both the mobile and desktop versions. Var kiteconnect = require("kiteconnect").kiteconnect;
Kiteconnectjs is a node client and can't be used in browser. Its possible to modify it and use it in webpage but you still need a backend server which will handle things like access token exchange.
Thanks, trying with the localhost and getting route not found errors while posting the below code, please advise. Note that jsonp datatype is used to prevent cross domain access issues. The url is also not working when directly accessed. And for content type, json was also tried but no luck.
@eeesathiaeee As said before you shouldn't be calling get access token call from frontend. Its should be implemented in backend and your frontend should talk to your backend to get data. Otherwise you will compromise your api secret and also access token to end user.
@vivek I understand we cannot access the url this way. But are those keys correct? If so I will try post method with other parameters in setheader. Please share an Ajax syntax for post method if possible. Thanks for your help.
Come on how can you expect people to spend time on your query if you give broken information? Mention the exact error message what you are getting for the above request.
Thanks @vivek@sujith . I am able to retrieve access token now. Understanding is that it will never be retrieved from client side js even with jsonp. So tried using server side php call from js and it worked fine.
@vivek@sujith It is understood that multiple users could be added to access the API key and secret if setup(please explain this process as well). If that is the case, will it be still 3 requests per second for API calls or is it per user/access token? Please advise.
Kite Connect is by default a personal app only. It is can't be used for multiple users. You need to create multiple apps to use APIs for multiple clients. If you are developing a platform then you can write to talk(at)rainmatter.com to get multi-user access.
$.ajax({
url: 'https://api.kite.trade/session/token',
dataType: 'json',
type: 'POST',
contentType: 'application/json',
data: {api_key, request_token, checksum},
beforeSend: function(xhr) {
xhr.setRequestHeader('X-Kite-Version: 3')
}, success: function(data){
alert(data);
}, error: function(){
alert("Unsuccessful login!");
}
});
Mention the exact error message what you are getting for the above request.
If you are developing a platform then you can write to talk(at)rainmatter.com to get multi-user access.