public XPress(string baseApiUrl)
{
this.baseApiUrl = baseApiUrl;
this.restClient = new RestClient(baseApiUrl);
DecodedToken dt = new DecodedToken(Authenticator.Instance.GetToken());
if (Util.ConvertUnixTime(dt.GetDecodedToken().exp) <= DateTime.Now)
{
Authenticator.Instance.RefreshToken();
this.restClient.Authenticator = new OAuth2AuthorizationRequestHeaderAuthenticator(Authenticator.Instance.GetToken(), "Bearer");
}
else
{
this.restClient.Authenticator = new OAuth2AuthorizationRequestHeaderAuthenticator(Authenticator.Instance.GetToken(), "Bearer");
}
}