Getting Series IDs

In order to enter a contest, we need the series ID for the contest we want to enter. A list of series and their corresponding ID can be found from the running series endpoint.

It should return 10 series, two one minute series, four five minute series, one fifteen-minute series, one hourly series, and two daily series.

// Series Settings const contestPair = "BTC/USD"; // BTC/USD Game const contestDuration = "00:15:00"; // 15 Minute const assetType = "HXRO"; // Wagering HXRO const apiToken = "api token"}; // API Token obtained from Hxro Account const https = require('https'); const options = { hostname: 'api.hxro.io', port: 443, path: '/hxroapi/api/contestseries/running', method: 'GET', headers: { 'Ocp-Apim-Subscription-Key': apiToken } } function getSeries(seriesObj, index) { return seriesObj.name == contestPair && seriesObj.contestDuration == contestDuration && seriesObj.assetType == assetType; }; const req = https.request(options, (res) => { var arr = ""; res.on('data', (part) => { arr += part; }); res.on('end', () => { var seriesArr = JSON.parse(arr) var series = seriesArr.filter(getSeries); var ret; if (series[0] && 'id' in series[0]) ret = series[0].id; else ret = "[Error]: Matching series not found."; console.log(ret); }); }); req.on('error', (e) => { console.error(e); }); req.end();
public RunningSeries GetContestSeries() { using (var client = new WebClient()) { string uriString = "https://api.hxro.io/hxroapi/api/contestseries/running"; client.Headers.Clear(); client.Headers.Add("Content-Type", "application/json"); var jsonResponse = client.DownloadString(uriString); return JsonConvert.DeserializeObject<IEnumerable<ContestSeriesViewModel>>(jsonResponse); } }

An example of a series from a successful response is as follows:

{ "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "contestSeriesStatus": "Draft", "isLocked": true, "assetType": "HXRO", "contestType": "OverUnder", "testingGroup": "string", "name": "string", "rake": 0, "minPlayers": 0, "recurIndefinitely": true, "instruments": [ { "assetIdBase": "string", "assetIdQuote": "string" } ], "contestDuration": "string", "absoluteGoLiveDate": "2020-01-17T20:32:24.742Z", "goLiveDate": "2020-01-17T20:32:24.742Z", "prizeStructure": "FiftyFifty" }