☰
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
14K
All Categories
0
Incidents
157
Node JS client
41
Go client
795
.Net API client
385
Kite Publisher
537
.Net / VBA / Excel (3rd party)
463
Algorithms and Strategies
1K
Java client
1.1K
API clients
407
PHP client
4.1K
Python client
349
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
General
In this Discussion
March 2024
sujith
kc.getIntruments call is failing when passing an array of strings example ['NSE' ,'BSE' ]
RishabhBhanot17
March 2024
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 2024
It only accepts one segment. You can refer to the documentation
here
.
Sign In
or
Register
to comment.