Please update the sample code for C#
Hi,
I tried to integrate the sample code with my C# application. I seen lot of things are not working. I cross verified the Java sample code and found lot of things are missing in C#. example: subscription key is not added in the header. Market Feed api is not at all working.
Please update the sample code.
Hi..!! Thank you for updating us on the missing Ocp-Apim-Subscription-Key in the C# sample code. We will update the sample code and upload it on GitHub. Can you share the API response which you are receiving as an error and also the name of APIs which are not working?
Request Body:
{"head":{"appName":"<maskedappName>","appVer":"1.0","key":"<maskedkey>","osName":"Android","requestCode":"IIFLMarRQMarketFeed","userId":"<maskedUserId>","password":"<maskedpwd>"},"body":{"MarketFeedData":[{"Exch":"N","ExchType":"C","ScripCode":"1624"}],"ClientCode":"99999<masked>","Count":1,"ClientLoginType":0,"LastRequestTime":"Date(637574773565314160)","RefreshRate":"H"}}
Request Header:
[{"Key":"Accept","Value":["application/json"]},{"Key":"Ocp-Apim-Subscription-Key","Value":["<maskedsubscriptionkey>"]},{"Key":"Cookie","Value":["IIFLMarcookie=4der1jikmndkeh2tn5dfkcpn"]}]
Response:
{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Cache-Control: private Date: Mon, 24 May 2021 14:25:14 GMT Request-Context: appId=cid-v1:6aa3a04c-7942-4767-a597-8eb4808c618a X-Android-Received-Millis: 1621866314682 X-Android-Response-Source: NETWORK 400 X-Android-Selected-Protocol: http/1.1 X-Android-Sent-Millis: 1621866314078 X-Powered-By: ASP.NET Content-Length: 1647 Content-Type: application/json }}
Please advise me anything is wrong in my request.
Hi @Navanethapperumal, Did you find any solution for MarketFeed ?
Dear @Navanethapperumal, In the request headers, for value = ["application/json"], the key should be "Content-Type". The value for "Accept" need not be passed in the request headers.
Dear @api-iifl-securities ,
In the market feed, I'm getting empty response now.
Request:
{"head":{"appName":"<maskedappName>","appVer":"1.0","key":"
Response: {"body":{"CacheTime":0,"Data":[],"Message":"","Status":0,"TimeStamp":"/Date(1649672907000+0530)/"},"head":{"responseCode":"IIFLMarRPMarketFeed","status":"0","statusDescription":"Success"}}
Market feed is working fine now for me. I have modified the LastRequestTime as UTC time and the issue has been resolved now.