<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Error due to fetchData function from WebSocketV2]]></title><description><![CDATA[<p dir="auto">When i use fetchData function from WebSocketV2 instance then it gives the error that i have provided in photo</p>
<p dir="auto">code :<br />
web_socket.fetchData({<br />
correlationID: "abcde12345",<br />
action: 1,<br />
params: {<br />
mode: 1,<br />
tokenList: [<br />
{<br />
exchangeType: 1,<br />
tokens: ["10626", "5290"],<br />
},<br />
{<br />
exchangeType: 5,<br />
tokens: ["234230", "234235", "234219"],<br />
},<br />
],<br />
},<br />
});<br />
<img src="/assets/uploads/files/1710066476289-screenshot-2024-03-10-155613.png" alt="Screenshot 2024-03-10 155613.png" class=" img-responsive img-markdown" width="1027" height="801" /></p>
<p dir="auto">I think this error is due to the  way it's fetching in websocket2.0.js file,<br />
it's fetch value as const { correlationID, action, mode, exchangeType, tokens } = json_req;  but in documentation it is written as {<br />
"correlationID": "abcde12345",<br />
"action": 1,<br />
"params": {<br />
"mode": 1,<br />
"tokenList": [<br />
{<br />
"exchangeType": 1,<br />
"tokens": [<br />
"10626",<br />
"5290"<br />
]<br />
},<br />
{<br />
"exchangeType": 5,<br />
"tokens": [<br />
"234230",<br />
"234235",<br />
"234219"<br />
]<br />
}<br />
]<br />
}<br />
}</p>
<p dir="auto">I request you please provide appropriate solution.</p>
]]></description><link>https://smartapi.angelone.in/smartapi/forum/topic/4417/error-due-to-fetchdata-function-from-websocketv2</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 19:08:08 GMT</lastBuildDate><atom:link href="https://smartapi.angelone.in/smartapi/forum/topic/4417.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Mar 2024 10:32:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Error due to fetchData function from WebSocketV2 on Tue, 19 Mar 2024 09:06:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://smartapi.angelone.in/smartapi/forum/uid/23803">@greatworld</a></p>
<p dir="auto">Apologies for the delayed response.<br />
Kindly find below working code to fetch data. Please verify and let us know if this helps.</p>
<p dir="auto"><strong>Code Snippet:</strong><br />
let web_socket = new WebSocketV2({<br />
jwttoken: 'jwt_token',<br />
apikey: 'api_key',<br />
clientcode: 'client_code',<br />
feedtype: 'feed_token',<br />
});</p>
<p dir="auto">web_socket.connect().then((res) =&gt; {<br />
let json_req = {<br />
correlationID: 'abcde12345',<br />
action: 1,<br />
mode : 1,<br />
exchangeType: 5,<br />
tokens: ["234230", "234235", "234219"],<br />
};<br />
web_socket.fetchData(json_req);<br />
web_socket.on('tick', receiveTick);<br />
function receiveTick(data) {<br />
console.log('receiveTick:::::', data);<br />
}<br />
});</p>
<p dir="auto">Regards,<br />
SmartAPI team</p>
]]></description><link>https://smartapi.angelone.in/smartapi/forum/post/15914</link><guid isPermaLink="true">https://smartapi.angelone.in/smartapi/forum/post/15914</guid><dc:creator><![CDATA[Moderator_2]]></dc:creator><pubDate>Tue, 19 Mar 2024 09:06:17 GMT</pubDate></item></channel></rss>