☰
Login
Signup
Home
›
.Net / VBA / Excel (3rd party)
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.8K
All Categories
0
Incidents
154
Node JS client
40
Go client
793
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
993
Java client
1.1K
API clients
404
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
April 2017
botany02
April 2017
sthapatiinfo
March 2017
sujith
Unable to place order
sthapatiinfo
March 2017
in
.Net / VBA / Excel (3rd party)
string url = "
https://api.kite.trade/orders/regular
";
string postData = "api_key=xxx&access_token=yyy&tradingsymbol=ACC&exchange=NSE&transaction_type=BUY&order_type=LIMIT&quantity=2&product=CNC&price=1400&validity=DAY&trigger_price=0&tag=acc123";
byte[] data = Encoding.UTF8.GetBytes(postData);
try
{
var request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/json; charset=UTF-8";
request.ContentLength = data.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
var response = (HttpWebResponse)request.GetResponse();
var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
}
catch (WebException ex)
{
}
Above code give me below eroor:
The remote server returned an error: (403) Forbidden.
sujith
March 2017
Hi
@sthapatiinfo
,
You need to make a post request to place order.
Please take a look at
documentation
for more information.
sthapatiinfo
March 2017
I have written " request.Method = "POST"; " already.
sujith
March 2017
@sthapatiinfo
,
Can you print the error message and check? I think your session might be expired.
sthapatiinfo
April 2017
Give me if you have a .net c# code for place order
botany02
April 2017
@sthapatiinfo
You can try
KiteDotNet
sthapatiinfo
April 2017
This API does not working with web version.
Sign In
or
Register
to comment.
You need to make a post request to place order.
Please take a look at documentation for more information.
Can you print the error message and check? I think your session might be expired.
You can try KiteDotNet