markitondemand / DEPRECATED-DataApis

Markit On Demand - Market Data APIs
http://dev.markitondemand.com
MIT License
178 stars 68 forks source link

Interactive API response missing prefix when using JSONP #3

Closed thilomaurer closed 11 years ago

thilomaurer commented 11 years ago

Hi,

the HTTP Request

http://dev.markitondemand.com/Api/Interactive/jsonp?callback=jQuery16209718675615731627_1381993829672&parameters=%7B%22Normalized%22%3Afalse%2C%22NumberOfDays%22%3A100%2C%22DataPeriod%22%3A%22Day%22%2C%22LabelPeriod%22%3A%22Day%22%2C%22ExtraPoints%22%3A0%2C%22Elements%22%3A%5B%7B%22Symbol%22%3A%22AAPL%22%2C%22Type%22%3A%22price%22%2C%22Params%22%3A%5B%22ohlc%22%5D%7D%2C%7B%22Symbol%22%3A%22AAPL%22%2C%22Type%22%3A%22volume%22%7D%5D%2C%22RealTime%22%3Afalse%7D&_=1381993839793

returns

{"Labels":null,"Positions":[...],"Dates":[...],"Elements":[{"Currency":"USD","TimeStamp":"2013-10-16 15:59:59-04","Symbol":"AAPL","Type":"price","DataSeries":{"open":{"min":413.6,"max":509.71,"values":[...]},"high":{"min":423.5,"max":513.74,"values":[...]},"low":{"min":410.38,"max":504,"values":[...]},"close":{"min":418.99,"max":507.74,"values":[...]}}},{"Currency":"USD","TimeStamp":"2013-10-16 15:59:59-04","Symbol":"AAPL","Type":"volume","DataSeries":{"volume":{"min":7109152,"max":32096208,"values":[...]}}}]}

while the correct answer would be:

jQuery16209718675615731627_1381993829672(
{"Labels":null,"Positions":[...],"Dates":[...],"Elements":[{"Currency":"USD","TimeStamp":"2013-10-16 15:59:59-04","Symbol":"AAPL","Type":"price","DataSeries":{"open":{"min":413.6,"max":509.71,"values":[...]},"high":{"min":423.5,"max":513.74,"values":[...]},"low":{"min":410.38,"max":504,"values":[...]},"close":{"min":418.99,"max":507.74,"values":[...]}}},{"Currency":"USD","TimeStamp":"2013-10-16 15:59:59-04","Symbol":"AAPL","Type":"volume","DataSeries":{"volume":{"min":7109152,"max":32096208,"values":[...]}}}]}
)

Is there something wrong with my request or is jsonp not supported?

markhealey commented 11 years ago

You're right in guessing that jsonp modifier should return a function-wrapped response. Read this comment to understand why this doesn't work today. Separately, we're working on some updates to these APIs and they'll be available in the next 10 days or so.

Thanks.

markhealey commented 11 years ago

This has been fixed in v2. Try this HTTP request using the v2 endpoint.