☰
Login
Signup
Home
›
Node JS client
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
153
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
March 19
sujith
kc.getIntruments call is failing when passing an array of strings example ['NSE' ,'BSE' ]
RishabhBhanot17
March 18
in
Node JS client
kc.getIntruments call is failing when passing an array of strings example ['NSE' ,'BSE' ] and is working for single exchange value. Can you please help fix this
async getInstruments(userId: string, segments: string[]): Promise {
try {
console.log("entered Get Instruments Service")
const kiteClient= await this.kiteConnectPool.getClient(userId);
console.log(kiteClient)
const response = await kiteClient.getInstruments(segments);
return response;
} catch (error) {
console.log(error)
throw error;
}
}
@Get('instruments')
async getInstruments(
@Query('userId')
userId: string,
@Query('segment')
segment: string[],
): Promise {
console.log(typeof(segment));
console.log(segment);
console.log("entered Get Instruments Controller")
return this.kiteClientService.getInstruments(userId, segment);
}
http://localhost:3000/kite-client/instruments?userId=&segment=BSE&segment=NFO&segment=MCX
Getting this error
{ message: 'Forbidden', error_type: 'NetworkException', data: null }
[Nest] 8020 - 03/19/2024, 1:17:18 AM ERROR [ExceptionsHandler] Forbidden
and this API is working without any authorization is this by default or there is some issue because I saw in the http documentation auth is required
Tagged:
kiteapi
kiteconnect
Kite Connect NodeJS
sujith
March 19
It only accepts one segment. You can refer to the documentation
here
.
Sign In
or
Register
to comment.