Jump to content
Sign in to follow this  
marc

Cannot find "USD/JPY DFT" market with ListSpreadMarkets

Recommended Posts

Hi, I am not able to find the USD/JPY DFT market when I use the ListSpreadMarkets API passing “USD/JPY” as market name. I thought this could be linked to the “/” so I’ve tried to UrlEncode the “USD/JPY” string before adding it in the URL, but to no avail. I believe this used to work few weeks back but now some of my tests are broken as a result.

You can repoduce the problen in the Ajax Test Harness page at :https://ciapipreprod.cityindextest9.co.uk/tradingapi

With the following code:

var userName = "DM631479";
doPost('/session',{ "UserName": userName, "Password": "password"}, function (data, textCode) {    
setRequestHeader("UserName", userName);
setRequestHeader("Session", data.Session);

// Authentication Test
doGet('/smoketest/authenticated');

// Spread Markets Test
doGet('/spread/markets?marketname=USD&maxresults=10&usemobileshortname=false');
doGet('/spread/markets?marketname=USD/JPY&maxresults=10&usemobileshortname=false');
doGet('/spread/markets?marketname=USD%2FJPY&maxresults=10&usemobileshortname=fasle');

//Logoff
doPost('/session/deleteSession?userName='+userName+'&session='+data.Session);
});

Share this post


Link to post
Guest sky.sanders

the ‘/’ is being apparently interpreted as part of the url even when being escaped. we ran into this early on in the development of the client libraries but the fix seems to have dropped out during one of the rewrites.

you have apparently found a workaround that the server recognizes for ‘/’. we will pull a full list of markets and scan for other non-numeric characters and ask for guidance from the API team.

i have implemented munging in the client library to address this issue.

Share this post


Link to post
Guest andreif

This must be due to “/” sign. When passing “USD JPY” string, it works well.

Share this post


Link to post

This must be due to “/” sign. When passing “USD JPY” string, it works well.

Yes I’m pretty sure this is the case, but excluding the “/” sign before passing it to the URL implicate everyone knows about those “non-working” characters (can’t see anything related in the documentation though) and filter them out before calling the API. I will do that for now, but in my opinion it’s something that should rather be taken care of at server level…

Share this post


Link to post
Guest andreif

This must be due to “/” sign. When passing “USD JPY” string, it works well.

@marc Not sure if this can be done on server level, but it certainly needs to be documented.

Share this post


Link to post
Guest sky.sanders

This must be due to “/” sign. When passing “USD JPY” string, it works well.

@marc i seem to remember running into this way back when in the client libraries. there may be a question here related. i will track down the issue in github and see if we got any guidance.

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  
×