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

    • Imagine a world where tokens are not just static assets but dynamic entities with executable scripts, thanks to ERC-5169 and TokenScript brought to life by the ingenious minds at Smart Layer. These technologies empower tokens to carry out intricate logic and front-end interactions, opening doors to endless possibilities. Trusted by over 1200 developers and 30 major brands, Smart Layer isn't just a concept; it's a proven solution embraced by industry leaders for its ability to tackle integration, privacy, and trust head-on. It's more than just a suite of technologies; it's a catalyst for the tokenized web revolution. At its core, Smart Layer introduces a paradigm shift, ushering in a trustless environment where token logic reigns supreme. Smart Tokens, the building blocks of this new era, encapsulate business logic in a blockchain-based format, enabling seamless interactions across systems and tokens. Tokenization becomes the linchpin of this transformative journey, as goods, services, and digital rights morph into programmable tokens. This not only streamlines integration but also fosters frictionless markets and empowers users in the digital realm.  As we look ahead to the next generation of the web, Smart Layer stands tall as the integration bus, connecting disparate systems and enabling limitless possibilities. It's not just about decentralized execution; it's about scalability, security, and a decentralized future where interactions are complex yet seamless. In this narrative of innovation, the Smart Layer isn't just a piece of the puzzle; it's the cornerstone of the Internet's future, a programmable service network facilitating decentralized interactions and shaping the digital landscape for generations to come. Am completely immersed with the ideology that this amazing innovation will reign supreme in this evolving industry and the tokens holders will have every reason to celebrate in the nearest future. Do you guys share the same sentiment or you think it's another over hyped project.
    • Blockchain technology has proven effective in various sectors where its use has been employed, and now businesses want to utilize its intelligence to raise user experiences and productivity. Sadly though, two major hurdles stand in their way: complex integrations, and data sharing regulations. Where tokenization promises to proffer solutions, scale and functionality limitations have halted its breakthrough; enter Smart Layer. Smart Layer promises us a new way to deliver business services that will unlock the next era of digital experiences. While current token functionality is limited by smart contracts, Smart Layer new token standard (EIP-5169) enables tokens to become Smart, and go beyond assets to deliver composable business services, thereby resolving the issue of extending token functionality. Through Smart Layer model, Web2 businesses are bound to build seamless user experiences by delivering more portable and composable services through tokenization, evading the need to build complex integrations with multiple chains. Smart Layer simply captures value with every integration and issued token, as businesses easily tokenize their experiences and services, and paves the way for seamless transition of businesses from web2 to web3. Smart Layer runs as a token-incentivised network of service nodes powered by Smart Layer token ($SLN), a token that has gained global attention thanks to its vast utilities and huge airdrop. Leading exchanges such as Bitget has also indicated interest in listing $SLN when the liquidity threshold is met. Your thoughts on this exciting project?
    • As blockchain technology and cryptocurrency adoption continues to surge, a lot of newbies seems to get discouraged due to the complexities involved in navigating through this evolving industry hence the reason why devs are constantly looking for ways to bring innovation that could ease the understandings of people embracing this industry. Thankfully IQ came through with a brilliant innovation where blockchain and cryptocurrency knowledge thrive. There, you'll find a wealth of wikis covering everything you need to know about the crypto world. It's not just an encyclopedia; it's a tool to empower you and shape the future of blockchain. Interestingly they don't rely solely on human effort. Their partnership with artificial intelligence, including OpenAI's GPT-4, helps scale content and make it more accessible. They're all about sharing knowledge in an easy, intuitive way. At the heart of their ecosystem is IQ.wiki, a hub for the curious, the seekers, and the scholars of blockchain. It's not just a source of information; it's a community united in the quest for understanding and growth. And powering it all is the IQ token, a symbol of commitment to a smarter future. More than just a cryptocurrency, it bridges the gap between artificial intelligence and blockchain, driving towards decentralization and empowerment. With a staggering 1173% up from the previous ATL, the tokens continues to get attention of both traders and investors alike and with many more CEXs now listing it on their platform, I think this AI token could follow the pattern of other top AI projects like TAO and AGIX or even surpass them. What are your thoughts
×
×
  • Create New...
us