Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiHatti committed Feb 3, 2020
2 parents 4f08543 + 7a34902 commit 4376bfd
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions README.md
@@ -0,0 +1,89 @@
# ALBATROSS-ATLAS API-Wrapper

A Simple wrapper-class for the Albatross-Atlas API. Compatible for C# and VB.Net

__NOTE: You might have to install the Newtonsoft.Json NuGet-Package__

### Usage (VB.Net)
```vbnet
' Create a connection to the Server
Dim fetcher As AtlasWrapper.AtlasWrapper = New AtlasWrapper.AtlasWrapper("https://sample.serviceprovider.com/atlas", "sampleUser", "samplePassword")

' Sets the Fetch-Timespan for requests that utilize the pLastReceivedTS-Parameter
fetcher.FetchSpan = New TimeSpan(3, 0, 0)

' Get registered devices
Dim devices = fetcher.Devices()

' Get device-ignitions
Dim ignitionsA = fetcher.Ignitions(Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
Dim ignitionsB = fetcher.Ignitions(Date.Now.AddHours(-4)) ' Does utilize FetchSpan

' Get the current positions of all devices (standard and extended versions)
Dim positionsA = fetcher.Positions()
Dim positionsB = fetcher.PositionsExtended()

' Get the location-history of a device (standard and extended versions)
Dim historyA1 = fetcher.History(8618762024422020, Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
Dim historyA2 = fetcher.History(8618762024422020, Date.Now.AddHours(-4)) ' Does utilize FetchSpan

Dim historyB1 = fetcher.HistoryExtended(8618762024422020, Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
Dim historyB2 = fetcher.HistoryExtended(8618762024422020, Date.Now.AddHours(-4)) ' Does utilize FetchSpan

' Get the location-history of all devices (standard and extended versions)
Dim totHistoryA = fetcher.TotalHistory(Date.Now.AddHours(-4))
Dim totHistoryB = fetcher.TotalHistoryExtended(Date.Now.AddHours(-4))

' Get list of all registered drivers
Dim drivers = fetcher.Drivers()

' Get the list of refuelings
Dim refuelingsA = fetcher.Refueling(Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
Dim refuelingsB = fetcher.Refueling(Date.Now.AddHours(-4)) ' Does utilize FetchSpan

' Custom API-Request
Dim customA = fetcher.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks")
Dim customB = AtlasWrapper.AtlasWrapper.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks", "samplePassword")
```

### Usage (C#)
```cs
// Create a connection to the Server
AtlasWrapper.AtlasWrapper fetcher = new AtlasWrapper.AtlasWrapper("https://sample.serviceprovider.com/atlas", "sampleUser", "samplePassword");

// Sets the Fetch-Timespan for requests that utilize the pLastReceivedTS-Parameter
fetcher.FetchSpan = new TimeSpan(3, 0, 0);

// Get registered devices
dynamic devices = fetcher.Devices();

// Get device-ignitions
dynamic ignitionsA = fetcher.Ignitions(DateTime.Now.AddHours(-4), DateTime.Now);// Does not utilize FetchSpan
dynamic ignitionsB = fetcher.Ignitions(DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
// Get the current positions of all devices (standard and extended versions)
dynamic positionsA = fetcher.Positions();
dynamic positionsB = fetcher.PositionsExtended();

// Get the location-history of a device (standard and extended versions)
dynamic historyA1 = fetcher.History(8618762024422020, DateTime.Now.AddHours(-4), DateTime.Now); // Does not utilize FetchSpan
dynamic historyA2 = fetcher.History(8618762024422020, DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
dynamic historyB1 = fetcher.HistoryExtended(8618762024422020, DateTime.Now.AddHours(-4), DateTime.Now); // Does not utilize FetchSpan
dynamic historyB2 = fetcher.HistoryExtended(8618762024422020, DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
// Get the location-history of all devices (standard and extended versions)
dynamic totHistoryA = fetcher.TotalHistory(DateTime.Now.AddHours(-4));
dynamic totHistoryB = fetcher.TotalHistoryExtended(DateTime.Now.AddHours(-4));

// Get list of all registered drivers
dynamic drivers = fetcher.Drivers();

// Get the list of refuelings
dynamic refuelingsA = fetcher.Refueling(DateTime.Now.AddHours(-4), DateTime.Now); // Does not utilize FetchSpan
dynamic refuelingsB = fetcher.Refueling(DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
// Custom API-Request
dynamic customA = fetcher.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks");
dynamic customB = AtlasWrapper.AtlasWrapper.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks", "samplePassword");
```

0 comments on commit 4376bfd

Please sign in to comment.