Status
Once you have succesfully retrieved an Authentication
Token, you can make requests to all the other API
endpoints, including the /status
method. A call to retrieve the current
status of your vessel will look like this:
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1N...XosykYIc" \
"https://api.floathub.com/v2/status"
except that you should include your actual (and much longer) Authorization
Token in the place of the example eyJhbGciOiJIUzI1N...XosykYIc
from
above. This call will return a JSON response that will include everything
the FloatHub system knows about the current state of your vessel. It will
look something like this:
[{"category":"Environmental","data":67.1,"name":"Air Temperature","subtype":"Air","time_utc":1668165282,"type":"Temperature","units":"fahrenheit"},
{"category":"Environmental","data":65.48,"name":"Water Temperature","subtype":"Water","time_utc":1668165282,"type":"Temperature","units":"fahrenheit"},
{"category":"Environmental","data":30.2151,"name":"Pressure","subtype":"Atmosphere","time_utc":1668165282,"type":"Pressure","units":"inhg"},
{"category":"Environmental","data":9.69,"name":"Depth","subtype":"Water","time_utc":1668165282,"type":"Depth","units":"feet"},
{"category":"Environmental","data":9.7192,"name":"Wind Speed (R)","subtype":"Speed","time_utc":1668165282,"type":"Wind","units":"knots"},
{"category":"Environmental","data":190.0,"name":"Wind Direction (R)","subtype":"Direction","time_utc":1668165282,"type":"Wind","units":"degrees"},
{"category":"Navigation","data":38.97483501434326,"name":"Latitude","subtype":"Fix","time_utc":1668165282,"type":"Location","units":"degrees"},
{"category":"Navigation","data":-76.4825618426005,"name":"Longitude","subtype":"Fix","time_utc":1668165282,"type":"Location","units":"degrees"},
{"category":"Navigation","data":185.65,"name":"Altitude","subtype":"Fix","time_utc":1668165282,"type":"Location","units":"feet"},
{"category":"Navigation","data":0.87,"name":"HDOP","subtype":"Fix","time_utc":1668165282,"type":"Location","units":""},
{"category":"Navigation","data":11,"name":"SIV","subtype":"Fix","time_utc":1668165282,"type":"Location","units":""},
{"category":"Navigation","data":0.007,"name":"SOG","subtype":"Motion","time_utc":1668165282,"type":"Location","units":"knots"},
{"category":"Navigation","data":63.0,"name":"COG","subtype":"Motion","time_utc":1668165282,"type":"Location","units":"degrees"},
{"category":"Navigation","data":0.0132487,"name":"STW","subtype":"Motion","time_utc":1668165282,"type":"Location","units":"knots"},
{"category":"Electrical","data":12.6704,"name":"Starter","subtype":"Battery","time_utc":1668165282,"type":"Voltage","units":"volts"},
{"category":"Counters","data":6,"name":"Primary Bilge (Last Day)","subtype":"Day","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":27,"name":"Primary Bilge (Last Week)","subtype":"Week","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":118,"name":"Primary Bilge (Last Month)","subtype":"Month","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":1,"name":"Backup (Last Day)","subtype":"Day","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":3,"name":"Backup (Last Week)","subtype":"Week","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":23,"name":"Backup (Last Month)","subtype":"Month","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":4,"name":"Sump (Last Day)","subtype":"Day","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":13,"name":"Sump (Last Week)","subtype":"Week","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Counters","data":43,"name":"Sump (Last Month)","subtype":"Month","time_utc":1668165282,"type":"Pumps","units":"frequency"},
{"category":"Position","data":{"lat":38.97483501434326,"lon":-76.4825618426005},"name":"Track","subtype":"History","time_utc":1668165282,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.97483501434326,"lon":-76.4825618426005},"name":"Track","subtype":"History","time_utc":1668165282,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.97493000030518,"lon":-76.48255519866943},"name":"Track","subtype":"History","time_utc":1668165252,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.97493000030518,"lon":-76.48255519866943},"name":"Track","subtype":"History","time_utc":1668165252,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.975063769022626,"lon":-76.48249219258626},"name":"Track","subtype":"History","time_utc":1668165222,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.975063769022626,"lon":-76.48249219258626},"name":"Track","subtype":"History","time_utc":1668165222,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.97485593159993,"lon":-76.48251450856527},"name":"Track","subtype":"History","time_utc":1668165192,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.97485593159993,"lon":-76.48251450856527},"name":"Track","subtype":"History","time_utc":1668165192,"type":"Track","units":"position"},
{"category":"Position","data":{"lat":38.97504685719808,"lon":-76.48248058954874},"name":"Track","subtype":"History","time_utc":1668165162,"type":"Track","units":"position"},
...
]
By inspecting the output above, we can see that the status data comes in five categories (Environmental, Navigation, Electrical, Counters, and a list of Positions which describe the most recent track of your vessel). We provide some additional detail on each of these categories below.
In all cases, the data
element will contain the actual current
observation for the measurement in question. And there will always be a time
fix (time_utc
) that is the standard UNIX timestamp of the data (always in
UTC and never adjusted for any timezone).
Units are always those that the user has specified in their account. There is (currently) no way to change the choice of units from the API, but any changes made via the website will immediately be reflected in subsequent API calls.
Environmental
The environmental category can include data with these types and subtypes:
Temperature → Air
Temperature → Water
Pressure → Atmosphere
Depth → Water
Wind → Speed
Wind → Direction
Note that is possible to receive more than 1 value for wind speed and direction on vessels that report both wind relative to the vessel’s centerline and absolute wind. In those cases, the name will include either an “(A)” or an “(R)” to indicate the type of measurment.
Electrical
The Electrical category currently includes:
Voltage → Battery
Voltage → Charger
Counters
This category currently includes only pumps, and will list how frequently each pump has run over the following time periods:
Pumps → Day
Pumps → Week
Pumps → Month
Depending on the account level (Basic, Enhanced, etc.) of the credentials in question, the weekly and monthly data may not be available.
Position
The shows the most recent track of the vessel over the last 24 hours by listing latitude and longitude values, together with a timestamp (again a UNIX UTC timestamp).