C# Wrapper to BetaSeries Rest API
If you find this package useful, please make a gift on Paypal : https://www.paypal.me/roddone
You need to get a DeveloperKey to use the API. first, go to BetaSeries API to ask a key, then you can register the key in the application :
RestHelper.RegisterDeveloperKey("my-developer-key");
This wrapper is designed to be ultra generic and to have the less code as possible. To do that a lot of types used in the solution are dynamic. In a future releases, I will try to implement custom methods with strong-typed return types and inputs. But for now this API works and can be used with any method of the API. Have a look on BetaSeries API to know how to use the different API methods !
BetaSeries API is based on a REST API, this package provides classes to access each entity of the API. The Rest API is based on a two levels URL (example: SHOWS/DISPLAY), this API consists in nested classes that matches the API urls and provide Delete, Get, Post and Put methods. example: for SHOWS/DISPLAY, I will use :
SHOWS.Display.[Delete|Get|Post|Put]();
All the Urls works the same way, all you have to do is to have a look on BetaSeries API to find the Urls you need to call.
All methods returns (for now) a dynamic object that contains the API response. Feel free to implement strong-typed response types if you need to use real return types.
All methods accepts a dynamic object as parameter. For Get and Delete operations, this object is passed as query-string parameters. For Post and Put operations, this object is passed in the body of the request.
Feel free to implement custom methods with strong-typed parameters for all the objects.
If you use Api methods that needs to ben authenticated, you have to use :
MEMBERS.Auth.Post(new {
login = "my-login",
Password = RestHelper.HashPassword("my-password")
});
MEMBERS.Auth returns an object that contains the token to use. You can now save it with RestHelper.RegisterUserToken(auth.token.ToString());
to use it automatically in all further calls.