Geolocation Service


Access info

Endpoint https://geolocation-log-api.socrate.io/graphql
Required access keys Tenant-level service access key
Pricing Please contact us for details at contact@bitsoftware.ro
Notes To call the service, the access key must be provided in the x-api-key header of the HTTP request. If you are using the GraphQL console, you can view the service’s documentation and schema only after entering an access key. Make sure that the scope of the key allows access to the queries and mutations that you require. For example, to grant the key access to all queries and mutations, the keys’s scope must be set to geolocation-log-api:query:* geolocation-log-api:mutation:*.

Usage

The Geolocation Service enables callers to store and query geolocation events. A geolocation event records the geographical position of an object at a particular time.

Queries

deviceGpsLocations

Arguments

Argument Type Description
filter DeviceGpsLocationsFilter Optional. Provides filtering options to the query.
limit Int Optional. Specifies the maximum number of records that should be returned in the result.
nextToken String Optional argument used to fetch the next set of query results. This value can be obtained from the nextToken attribute of the DeviceGpsLocationResult type.
DeviceGpsLocationsFilter input
Attribute Type Description
deviceId ID Optional. If provided, only events logged by this device will be returned.
recordedAt DateFilter Optional. If provided, only events logged within this date range will be returned.
DateFilter input
Attribute Type Description
from String Provides the starting date and time of the range.
to String Provides the end date and time of the range.

Result

DeviceGpsLocationResult type
Attribute Type Description
items [DeviceGpsLocation] An array of objects of type DeviceGpsLocation.
nextToken [DeviceGpsLocation] If null, then the query has reached the end of the list of results that match the query criteria. If not null, then use this value in the nextToken input argument, with the same filter, to fetch the next set of results.
DeviceGpsLocation type
Attribute Type Description
deviceId ID The ID of the device that recorded the event.
altitude Float The altitude (in meters) associated with the event.
geoLocation [Float] This is an array of two values [longitude, latitude] that identifies the geographical location of the recorded event in decimal degrees notation. For example, [40.848447, -73.856077].
recordedAt DateTime The date and time when the event was recorded.
createdAt DateTime The date and time when the event was created in SBS.
createdBy ID The identifier of the user that created this record.

version

Returns the API version.

Mutations

addDeviceGpsLocation

Arguments

Attribute Type Description
input DeviceGpsLocationInput Mandatory. Provides input data to the mutation.
DeviceGpsLocationInput type
Attribute Type Description
deviceId ID! Mandatory. The identifier of the device that recorded the geolocation event.
altitude Float Optional. The altitude, in meters, of the geolocation event.
geoLocation [Float]! Mandatory. This is an array of two values [longitude, latitude] that identifies the geographical location of the recorded event in decimal degrees notation. For example, [40.848447, -73.856077].
recordedAt DateTime! Mandatory. The date and time when the event was recorded.
createdBy ID The identifier of the user that created this record.

Result

See the DeviceGpsLocation type.

Example

The following call stores the position of an object as it was recorded on the 23rd of August 2023, 13:05:09 GMT.

mutation addEvent($input:DeviceGpsLocationInput) {
  addDeviceGpsLocation(input:$input) {
    deviceId
    altitude
    geoLocation
    recordedAt
    createdAt
    createdBy
  }
}
{
  "input": {
    "deviceId": "12345-6789",
    "geoLocation": [-100.3101, 76.8613],
    "recordedAt": "2023-08-23T13:05:09Z",
    "createdBy": "4a853563-5a4d-457f-bc57-52dcc5719886"
  }
}