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

    • All Those Token is FAKE The Moment The Token is Live For TRADE On The Exchanges The Price Goes Up Then You Buy At The Top Thinking The PRICE WILL Continue To Go Up And Then What Happen is immediately After You Hit The GREEN Button To Buy The PRICE Starts  GOING DOWN AND Never Back Up Again And You Loss You're Money Thanks What's Fake Token is .
    • You can start by doing research on different exchanges, learning about different cryptocurrencies, and practicing with a small amount of money before investing larger sums. Additionally, there are many online resources, courses, and communities that can help guide you in learning how to trade cryptocurrency.
    • What is Foreign Exchange? Foreign exchange (Forex or FX) is the conversion of one currency into another at a specific rate known as the foreign exchange rate. The conversion rates for almost all currencies are constantly floating as they are driven by the market forces of supply and demand. The most traded currencies in the world are the United States dollar, Euro, Japanese yen, British pound, and Australian dollar. The US dollar remains the key currency, accounting for more than 87% of total daily value traded.Factors that Affect Foreign Exchange Rates Many factors can potentially influence the market forces behind foreign exchange rates. The factors include various economic, political, and even psychological conditions. The economic factors include a government’s economic policies, trade balances, inflation, and economic growth outlook. Political conditions also exert a significant impact on the forex rate, as events such as political instability and political conflicts may negatively affect the strength of a currency. The psychology of forex market participants can also influence exchange rates. The Foreign Exchange Market The foreign exchange market is a decentralized and over-the-counter market where all currency exchange trades occur. It is the largest (in terms of trading volume) and the most liquid market in the world. On average, the daily volume of transactions on the forex market totals $5.1 trillion, according to the Bank of International Settlements’ Triennial Central Bank Survey (2016). The forex market major trading centers are located in major financial hubs around the world, including New York, London, Frankfurt, Tokyo, Hong Kong, and Sydney. Due to this reason, foreign exchange transactions are executed 24 hours, five days a week (except weekends). Despite the decentralized nature of forex markets, the exchange rates offered in the market are the same among its participants, as arbitrage opportunities can arise otherwise. The foreign exchange market is probably one of the most accessible financial markets. Market participants range from tourists and amateur traders to large financial institutions (including central banks) and multinational corporations. Also, the forex market does not only involve a simple conversion of one currency into another. Many large transactions in the market involve the application of a wide variety of financial instruments, including forwards, swaps, options, etc. Foreign currency exchange (forex) A foreign currency exchange rate is a price that represents how much it costs to buy the currency of one country using the currency of another country. Currency traders buy and sell currencies through forex transactions based on how they expect currency exchange rates will fluctuate. When the value of one currency rises relative to another, traders will earn profits if they purchased the appreciating currency, or suffer losses if they sold the appreciating currency.  
×
×
  • Create New...
us