Skip to content

Commit 4376bfd

Browse files
committed
2 parents 4f08543 + 7a34902 commit 4376bfd

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# ALBATROSS-ATLAS API-Wrapper
2+
3+
A Simple wrapper-class for the Albatross-Atlas API. Compatible for C# and VB.Net
4+
5+
__NOTE: You might have to install the Newtonsoft.Json NuGet-Package__
6+
7+
### Usage (VB.Net)
8+
```vbnet
9+
' Create a connection to the Server
10+
Dim fetcher As AtlasWrapper.AtlasWrapper = New AtlasWrapper.AtlasWrapper("https://sample.serviceprovider.com/atlas", "sampleUser", "samplePassword")
11+
12+
' Sets the Fetch-Timespan for requests that utilize the pLastReceivedTS-Parameter
13+
fetcher.FetchSpan = New TimeSpan(3, 0, 0)
14+
15+
' Get registered devices
16+
Dim devices = fetcher.Devices()
17+
18+
' Get device-ignitions
19+
Dim ignitionsA = fetcher.Ignitions(Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
20+
Dim ignitionsB = fetcher.Ignitions(Date.Now.AddHours(-4)) ' Does utilize FetchSpan
21+
22+
' Get the current positions of all devices (standard and extended versions)
23+
Dim positionsA = fetcher.Positions()
24+
Dim positionsB = fetcher.PositionsExtended()
25+
26+
' Get the location-history of a device (standard and extended versions)
27+
Dim historyA1 = fetcher.History(8618762024422020, Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
28+
Dim historyA2 = fetcher.History(8618762024422020, Date.Now.AddHours(-4)) ' Does utilize FetchSpan
29+
30+
Dim historyB1 = fetcher.HistoryExtended(8618762024422020, Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
31+
Dim historyB2 = fetcher.HistoryExtended(8618762024422020, Date.Now.AddHours(-4)) ' Does utilize FetchSpan
32+
33+
' Get the location-history of all devices (standard and extended versions)
34+
Dim totHistoryA = fetcher.TotalHistory(Date.Now.AddHours(-4))
35+
Dim totHistoryB = fetcher.TotalHistoryExtended(Date.Now.AddHours(-4))
36+
37+
' Get list of all registered drivers
38+
Dim drivers = fetcher.Drivers()
39+
40+
' Get the list of refuelings
41+
Dim refuelingsA = fetcher.Refueling(Date.Now.AddHours(-4), Date.Now) ' Does not utilize FetchSpan
42+
Dim refuelingsB = fetcher.Refueling(Date.Now.AddHours(-4)) ' Does utilize FetchSpan
43+
44+
' Custom API-Request
45+
Dim customA = fetcher.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks")
46+
Dim customB = AtlasWrapper.AtlasWrapper.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks", "samplePassword")
47+
```
48+
49+
### Usage (C#)
50+
```cs
51+
// Create a connection to the Server
52+
AtlasWrapper.AtlasWrapper fetcher = new AtlasWrapper.AtlasWrapper("https://sample.serviceprovider.com/atlas", "sampleUser", "samplePassword");
53+
54+
// Sets the Fetch-Timespan for requests that utilize the pLastReceivedTS-Parameter
55+
fetcher.FetchSpan = new TimeSpan(3, 0, 0);
56+
57+
// Get registered devices
58+
dynamic devices = fetcher.Devices();
59+
60+
// Get device-ignitions
61+
dynamic ignitionsA = fetcher.Ignitions(DateTime.Now.AddHours(-4), DateTime.Now);// Does not utilize FetchSpan
62+
dynamic ignitionsB = fetcher.Ignitions(DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
63+
64+
// Get the current positions of all devices (standard and extended versions)
65+
dynamic positionsA = fetcher.Positions();
66+
dynamic positionsB = fetcher.PositionsExtended();
67+
68+
// Get the location-history of a device (standard and extended versions)
69+
dynamic historyA1 = fetcher.History(8618762024422020, DateTime.Now.AddHours(-4), DateTime.Now); // Does not utilize FetchSpan
70+
dynamic historyA2 = fetcher.History(8618762024422020, DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
71+
72+
dynamic historyB1 = fetcher.HistoryExtended(8618762024422020, DateTime.Now.AddHours(-4), DateTime.Now); // Does not utilize FetchSpan
73+
dynamic historyB2 = fetcher.HistoryExtended(8618762024422020, DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
74+
75+
// Get the location-history of all devices (standard and extended versions)
76+
dynamic totHistoryA = fetcher.TotalHistory(DateTime.Now.AddHours(-4));
77+
dynamic totHistoryB = fetcher.TotalHistoryExtended(DateTime.Now.AddHours(-4));
78+
79+
// Get list of all registered drivers
80+
dynamic drivers = fetcher.Drivers();
81+
82+
// Get the list of refuelings
83+
dynamic refuelingsA = fetcher.Refueling(DateTime.Now.AddHours(-4), DateTime.Now); // Does not utilize FetchSpan
84+
dynamic refuelingsB = fetcher.Refueling(DateTime.Now.AddHours(-4)); // Does utilize FetchSpan
85+
86+
// Custom API-Request
87+
dynamic customA = fetcher.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks");
88+
dynamic customB = AtlasWrapper.AtlasWrapper.CustomRequest("https://sample.serviceprovider.com/atlas/sampleUser/tasks", "samplePassword");
89+
```

0 commit comments

Comments
 (0)