Jump to content
  • 0

https://demo-api.ig.com/gateway/deal/markets -> error.better-search.invalid-call


KML

Question

Dear all.

I'm playing around with the API using Java. I've been able to log in (version 1), listing accounts (https://demo-api.ig.com/gateway/deal/accounts), listed top level nodes (marketnavigation) and subscribed to some information using the LightStreamer client.

However, I'm now trying the /markets endpoint, but with no success so far. For instance, I get status 401, with error code "error.better-search.invalid-call". I'm not able to find this error message in the documentation. The same endpoint work when I try the API companion.

Any help highly appreciated!

  • Like 1
Link to comment

5 answers to this question

Recommended Posts

  • 0

I'm experiencing the same issue. I can call top-level nodes but when I try to call '/markets' I get the same '{"errorCode":"error.better-search.invalid-call"}' response. 

 

https://demo-api.ig.com/gateway/deal/markets?searchTerm=FTSE is working in the API companion but when I use exactly the same string on my node server it returns the error. 

 

const headers = {
'CST': cst,
'X-IG-API-KEY': key,
'IG-ACCOUNT-ID': accountId,
}
const markets = () => {
console.log(headers)
request({
url: `https://demo-api.ig.com/gateway/deal/markets?searchTerm=FTSE`,
method: "GET",
headers
}, function (error, response, body) {
console.log(body)
});
}
markets()
 
returns '{"errorCode":"error.better-search.invalid-call"}'
  • Like 1
Link to comment
  • 0

Hi @KML and @Will7,
Do you mean the https://github.com/IG-Group/ig-webapi-java-sample?
I cannot connect...
But this is already a step forward, after I failed to get the Schopenhauer Nodes code to work.

Which JDK do you use, Oracle11, too?
On Windows or Linux?
Do you use the "default profile", too?
I only changed  file src/main/resources/environment.properties
ig.api.domain.URL = https://api.ig.com/gateway/deal
I can connect to the production site in the  companion.

 

~/jdk-11.0.21/bin/java -jar target/ig-webapi-java-sample-console-2.2.0-SNAPSHOT.jar usr pwd apikey

 Starting Application v2.2.0-SNAPSHOT on PC with PID 59372 (started by markus in .../ig-webapi-java-sample/ig-webapi-java-sample-console)
No active profile set, falling back to default profiles: default
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:.../ig-webapi-java-sample-console/target/ig-webapi-java-sample-console-2.2.0-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-4.3.2.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Connecting as usr
Invalid cookie header: "Set-Cookie:  Invalid 'expires' attribute: Fri, 10 Jan 2025 17:16:26 GMT
...4 more invalid cookies...
Unexpected error:
org.springframework.web.client.HttpClientErrorException: 403 Forbidden

 

Edited by m123m123
language
Link to comment
  • 0

Thanks for your input. I started to code from scratch, using JDK 11 on Linux. That is, I did not start with the code from Githup.

Not sure what you mean by default profile, but I had to create a specific username/password for the application in addition to the one I use when I log in myself. As the user interface in Norwegian, I'm not sure on the exact wording in the menues, but the link is https://www.ig.com/no/myig/settings/api-keys. Not that there are different entries for live and demo accounts.

The application uses the same username/password as I do in the API companion.

Link to comment

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
  • image.png

  • Posts

    • after last weeks sell off'  a chart showing price in a possible discount & at a previous level of interest 
    • Solana ($SOL) is facing a challenging period in the market, with its price dropping to $130.56 USD. Here’s a closer look at what’s happening and what might be next for SOL. Recent Price Decline 15.17% Drop in a Month: Over the past month, Solana coin has fallen by 15.17%. This decline reflects the broader market’s pressure on the cryptocurrency. 8.5% Weekly Fall: Just this week, Solana saw an 8.5% drop, a sign that bears are firmly in control. Despite attempts to maintain a bullish outlook, the market seems to have different plans. Critical Support Levels Breakdown of $134 Support: Recently, SOL broke through the $134 support level, raising concerns that further declines could be on the way. Key Support at $122: The $122 level is now under the spotlight. This price point has been tested six times, and many whales view it as crucial. A break below this could push SOL towards $90. But if this support holds, it might set the stage for a bullish turnaround. $100 Support: While the $100 support level is still a bit distant, it’s essential to watch if the current bearish momentum continues. Revisiting this level could spell trouble for Solana. Changing Market Sentiment Shift to Bearish: The overall sentiment around Solana is slowly turning bearish. Since March, SOL has struggled to make new highs, and the current price action suggests that new lows could be coming. Potential Bullish Outcome: However, some analysts believe that if Solana manages to stay above $122 throughout 2024 and 2025, it could be incredibly bullish for the future, possibly leading to significant gains in 2025. Upcoming Breakpoint Event Historical Price Surges: There’s a potential catalyst on the horizon. Historically, Solana has seen price surges two weeks before its annual Breakpoint event. In previous years, SOL surged by 35% in 2021 and 2022, and by 60% in 2023. 2024 Event: With 16 days left until the 2024 Breakpoint event, could we see another rally? Only time will tell. The Importance of $122 Support As Solana approaches the $122 support level, all eyes are on whether it will hold. A break below could lead to further declines, while maintaining this support could bring back some bullish momentum. As always, stay informed, and remember the old adage in crypto: "buy the rumor, sell the news." Keep watching the charts as we near the 2024 Breakpoint event.  
    • One of the prominent cryptocurrency exchange, has maintained its commitment to user security through its Protection Fund. This self-insured fund, designed to safeguard user assets against potential threats such as hacks, fraud, and market volatility, has shown remarkable stability and growth. The fund has consistently maintained a value above $390 million, surpassing Bitget's initial commitment of $300 million. The exchange ability to continues to maintain a reserve ratio well above 150%, indicating a strong buffer against potential risks. The fund's value has shown correlation with Bitcoin's price movements, demonstrating its responsiveness to market conditions. Over the observed period, the fund's value peaked at $424.8 million and reached a low of $350.7 million, showcasing its ability to withstand market volatility while maintaining a substantial baseline. In February, the fund reached an all-time high valuation of over $543 million, coinciding with broader market uptrends. The Protection Fund's portfolio includes high-liquidity cryptocurrencies such as BTC, USDT, and USDC, which contributes to its stability and liquidity. This diversification strategy aims to mitigate risks associated with external market factors. Bitget's approach of self-funding and internally managing the Protection Fund allows for potentially quicker response times in critical situations, as it operates independently of external regulations and approvals. As the cryptocurrency market continues to evolve, the performance and management of such security measures will likely remain a point of interest for both users and industry observers.
×
×
  • Create New...
us