A C# client for Automatic's API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd
src
.gitignore
AutomaticSharp.sln
LICENSE
README.md
appveyor.yml

README.md

Build status NuGet

AutomaticSharp

A C# client for Automatic's REST API.

Usage

Authentication

The Automatic OAuth2 Workflow can be completed using the Microsoft.AspNet.Authentication.OAuth framework.

In a modern webapp you can add this to your startup.cs

app.UseAutomaticAuthentication(options =>
    {        
        //Add Automatic API key
        options.ClientId = Configuration["automatic:clientid"];
        options.ClientSecret = Configuration["automatic:clientsecret"];
        
        //Add desired scopes       
        options.AddScope(AutomaticScope.Public);
        options.AddScope(AutomaticScope.UserProfile);
        options.AddScope(AutomaticScope.Location);
        options.AddScope(AutomaticScope.VehicleEvents);
        options.AddScope(AutomaticScope.VehicleProfile);
        options.AddScope(AutomaticScope.Trip);
        options.AddScope(AutomaticScope.Behavior);       
    });

Getting Data

Using the Client you can query for data from Automatic's REST API. More examples can be found in the demo application which can be viewed here.

var client = new Client(access_token);
var vehicles = (await client.GetVehiclesAsync()).Results;