I'm doing an implementation of the API in C# .NET using HTTPClient to call the API. I've implemented all the ENUMS and Types and I'm just going through tests for all the Component EndPoints to make sure I've not messed anything up.
The 2 endpoints I've tested so far applyCoupons & removeMarkets from the Guardian component, work fine using POST requests. I'm getting back the results I'm expecting.
The issue I have is with the getTradingWindows endpoint. According to the documentation there's no Instructions to send in the POST request like all the other endpoints in the API.
Is the call to this endpoint a POST request with an empty body or is it a simple GET REQUEST?
The Test I did was:
1) Add markets to Guardian (applyCoupon)
2) I opened a market in the main-window of BetAngel, opened a new window (by right clicking on a Guardian Row) - So I believe I have 2 trading windows open.
3) Send Get request to open trading windows (getTradingWindows) - I get back "Error: NotFound"
4) Both trading windows still open and active. I sent a POST request with an empty body to the getTradingWindows. Got nothing
Here's the BetAngel Api Log file contents ( I refreshed this after each step of the above)
The log only shows the API responded to steps 1 and 4. Nothing was recorded for step 3 (GET request).08/07/2024 12:10:15.151:APIServerManager: Activating Server
08/07/2024 12:10:15.209:APIServer: StartAPIHost url=http://localhost:9000/
08/07/2024 12:10:15.736:APIServer: Start of Configuration
08/07/2024 12:10:15.893:APIServer: End of Configuration
08/07/2024 12:10:15.994:APIServerManager: Server Activated
08/07/2024 12:11:11.876:APIServerMessageHandler: Url = http://localhost:9000/api/guardian/v1.0/applyCoupon
08/07/2024 12:11:11.877:APIServerMessageHandler: Data = {"couponName":"Horse Racing - Test","clearOption":"CLEAR_GUARDIAN_AND_WATCH_LIST","watchListNumber":1}
08/07/2024 12:11:14.843:APIServerMessageHandler: Response Data = {"status":"OK","marketIdsAdded":["1.230465751","1.230465752","1.230465747","1.230465749","1.230465757","1.230465753","1.230465754","1.230465760","1.230465763","1.230465764","1.230465761","1.230465766","1.230465768","1.230465776","1.230465777","1.230465772","1.230465774","1.230465782","1.230465783","1.230465779","1.230465780","1.230465994","1.230465990","1.230465991","1.230465997","1.230466001","1.230466002","1.230465999","1.230466004","1.230466008","1.230466009","1.230466006","1.230466014","1.230466015","1.230466011","1.230466012","1.230466018","1.230466022","1.230466023","1.230466020","1.230466028","1.230466029","1.230466025","1.230466026","1.230468752","1.230468754","1.230468753","1.230468757","1.230468759","1.230468758","1.230468762","1.230468764","1.230468763","1.230468771","1.230468767","1.230468769","1.230468768","1.230468772","1.230468776","1.230468774","1.230468773","1.230468781","1.230468777","1.230468779","1.230468778","1.230468782","1.230468784","1.230468783","1.230466032","1.230466036","1.230466037","1.230466034","1.230466039","1.230466043","1.230466044","1.230466041","1.230466049","1.230466050","1.230466046","1.230466047","1.230466056","1.230466057","1.230466053","1.230466054","1.230466062","1.230466063","1.230466059","1.230466060","1.230466068","1.230466069","1.230466065","1.230466066","1.230466075","1.230466076","1.230466072","1.230466073","1.230466082","1.230466083","1.230466079","1.230466080","1.230466088","1.230466085","1.230466089","1.230466086","1.230466095","1.230466092","1.230466096","1.230466093","1.230466103","1.230466099","1.230466104","1.230466101","1.230466109","1.230466106","1.230466110","1.230466107","1.230466115","1.230466112","1.230466116","1.230466113","1.230466122","1.230466119","1.230466123","1.230466120","1.230466129","1.230466126","1.230466130","1.230466127"]}
08/07/2024 12:18:47.457:APIServerMessageHandler: Url = http://localhost:9000/api/guardian/v1.0 ... ingWindows
08/07/2024 12:18:47.474:APIServerMessageHandler: Data = null
08/07/2024 12:18:47.477:APIServerMessageHandler: Response Data = {"Message":"No HTTP resource was found that matches the request URI 'http://localhost:9000/api/guardian/v1.0 ... etail":"No route data was found for this request."}
The code I use to send HTTP requests that works
The different versions of code I've tried for the getTradingWindows issue, see belowstring postData = JsonSerializer.Serialize(Instruction);
var data = new StringContent(postData, Encoding.UTF8, "application/json");
return client.PostAsync(uri, data);
1) // Attempting a POST with no content in the POST body using null
var data = new StringContent(null, Encoding.UTF8, "application/json");
return client.PostAsync(uri, data);
2) // Attempting a POST with no content in the POST body using null
return client.PostAsync(uri, null);
3) // A GET request
return client.GetAsync(uri);
I've tried looking at the Bet Angel API Tests that BetAngel API provides, but there's none for Trading Windows.
Any help clarification or help is appreciated.
Thank you in advance