RicOneApi.Api.XPress.XPress C# (CSharp) Method

XPress() public method

public XPress ( string baseApiUrl ) : System
baseApiUrl string
return System
        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");
            }
        }