Matrix 1 Report post Posted May 20 Hi, I am trying to list market information for a few market ids. I have included the correct ids in a json array inside a httpPost and I get a 200 response but the response MarketInformation property is always an empty json array. I have tried credentials inside query string and header. Other httpPosts work fine such as login. I can do a searchwithtags httpGet request fine. Is there a problem with this particular service? Thanks. Share this post Link to post
Physicsman 30 Report post Posted May 20 Hi Matrix, Without seeing the call you are sending I cannot say where the error lies. However, the service is working normally as expected. Below is a screenshot showing the call I am sending that is retuning the market information as exepcted. Hopefully, you can use this to guide you into formatting your call correctly. The Headers of the call are should contain the login Session Id and the account login username. Kind Regards, PM Share this post Link to post
Matrix 1 Report post Posted May 20 Hi thanks, Ive jigged around with headers etc with no luck. All my parameters are correct. Ive used a third party tool to send a Post request with exactly the same result. My account is not live it is a test account. Will this make a difference. Thanks. Share this post Link to post
Physicsman 30 Report post Posted May 20 Hi, A test account should also work. The call I sent above is also using a test account on the Live/Production environment. If you can cut and paste the full copy of the call you are sending I can check it and see if I spot anything there. Kind Regards, PM Share this post Link to post
Matrix 1 Report post Posted May 20 https://ciapi.cityindex.com/TradingApi/market/information {"MarketIds":[401166448]} UserName DM797427 Session f3664738-bd24-4a28-a004-8751c3d10335 Content-Type application/json {"MarketInformation":[]} Copied from third party tool. Im using Java HttpClient inside the app. Share this post Link to post
Physicsman 30 Report post Posted May 20 I forgot to ask earlier, how did you find the MarketId? Did you follow the process as described in: https://docs.labs.gaincapital.com/#How Do I/Find Market ID.htm?TocPath=How%20Do%20I...%3F%7C_____1 If you are using a MarketId from one of the examples in the documentation, then the likely reason is that your account does not have access to that market. Try getting a MarketId using the process describe din the link so we know ti is one you can access with yoru account. I'll take a closer look at your POST details to see if I can spot anything, Share this post Link to post
Matrix 1 Report post Posted May 20 Ive just used one in the documentation although using the ID ive given I can stream price data without a problem. So you think I need to use this process you have given? When I use searchwithtags it works fine and brings back the ID given above? Share this post Link to post
Matrix 1 Report post Posted May 23 Just for completion. There are a number of marketIds for each market and depending upon your account different Ids seem to be returned. You need the correct Id (from ListMarketSearch). Interestingly even though an incorrect id (returned from SearchWithTags for example) allows you to stream prices the same id does not work with GetMarketInformation. Many thanks. Share this post Link to post
Physicsman 30 Report post Posted May 23 Hi Matrix, From reading your above posts, you were able to solve the problem by using the IDs for markets that your account has access to, is that correct? Kind Regards, PM Share this post Link to post
Matrix 1 Report post Posted May 24 Yes thats correct, but different IDs can be used for streaming price data. A bit confusing. 1 Physicsman reacted to this Share this post Link to post