Jump to content
Sign in to follow this  
Matrix

List Market Information

Recommended Posts

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

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.

image.png

 

The Headers of the call are should contain the login Session Id and the account login username.

image.png

 

Kind Regards, PM

 

 

Share this post


Link to post

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

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

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

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×