Interface IRestApi
Used to make Rest API calls against a MyGeotab web server.
public interface IRestApi
Properties
Database
Gets or sets the specific database on the server to which the API call is being made.
string Database { get; set; }
Property Value
LoginResult
Gets or sets the result of the login request.
LoginResult? LoginResult { get; set; }
Property Value
Password
Sets the user's password.
string Password { set; }
Property Value
Server
Gets or sets the name of the server that the API call is being made to.
string Server { get; set; }
Property Value
SessionId
Gets or sets the token generated from the authentication call which can be used to make the API call instead of the password.
string? SessionId { get; set; }
Property Value
Timeout
Gets or sets the timeout for the requests in milliseconds.
int Timeout { get; set; }
Property Value
UserName
Gets or sets the username (typically an email address) that identifies the user being authenticated.
string UserName { get; set; }
Property Value
Methods
AuthenticateAsync(CancellationToken)
Authenticate the user in an async call.
Task AuthenticateAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenThe CancellationToken.
Returns
- Task
A Task which is a result of calling AuthenticateImplAsync.
GetAsync(string, CancellationToken)
Make a GET http request.
Task<HttpResponseMessage> GetAsync(string url, CancellationToken cancellationToken = default)
Parameters
url
stringThe url for the REST api.
cancellationToken
CancellationTokenThe CancellationToken.
Returns
- Task<HttpResponseMessage>
The HttpResponseMessage which is the result of the api call.