Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To help you get familiar with Skylight's GraphQL API, the following example will instruct you on building a query that returns Dark Rendezvous and Standard Rendezvous events between May 1, 2023 and May 2, 2023. To make things easier, the return is limited to only one page with five events.

Full documentation for the Skylight GraphQL API can be found here: http https://api.skylight.earth/schema/query.doc.html

Getting Started

After opening Postman, import the environment variables file and the collections that contains the sample queries

Importing Environment Variables

The sample file uses environment variable so that you can pass in URL and access token for different queries instead of entering them manually for each query. We created the file for you to get started.

...

You will see the {{base_url}} and {{access_token}}

...


Importing the Collection

  1. Click on Collections

  2. Import the *.postman_collection.json. You will see the GraphQL collection added to the list.

...

Running the Queries

Set the environment

Before running the query, you need to set your environment. Click on the “No environment” drop down as shown below and select the environment file you imported.

...

For each query, the value for the {{base_url}} is https://api.skylight.earth. Since {{base_url}} is an environment variable, you can pass in this variable or any variables automatically.

Generate an access token

To generate an access token, run the getToken query first. This token will expire after 24 hours. Do not attempt to generate a new session while the token is active. The platform doesn't allow two active sessions open for the same user and doing so will end the active session. For the following queries, the access_token will be automatically passed on. To see the automation used to run the access_token, see the Tests tab. The username and password in the getToken query are the same username and password you use to log into the Skylight app. If you do not have a Skylight login, please contact us to request an account.

...

You will see a Postman query for "events" below. This query can be used to return all event types, although in our example we will be returning only Dark and Standard Rendezvous.

...

Input Fields

For our example we will run a query that returns Dark Rendezvous and Standard Rendezvous events between May 1, 2023 and May 2, 2023. The results will be limited to only 1 page where each page returns 5 events. The following arguments are used to filter the results:

...

One of the arguments used in the sample query is eventType. This filter is a list that contains a pre-defined value. Since we want to get a list of Dark Rendezvous and Standard Rendezvous events, we need to look at eventTypes to see the value assigned for this object. You will see “dark_rendezvous” and “standard_rendezvous” are the two values we need for our query.

...

Output Fields

With GraphQL you can select from all fields which need to be returned. For this query example we want this information:

...

Running the query gives a response similar to the below:

...

Event Type Specific Response

Response fields in Event and EventDetails might be tied to a specific event type hence it will only return a result when your arguments is containing that event. Below is the matrix of fields:

...

Fields

standard_rendezvous

dark_rendezvous

fishing_activity_history

detection

speed_range

aoi_visit

dark_activity

viirs

sar_sentinel1

eo_sentinel2

Event

event_id

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

event_type

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

start

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

vessels

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

event_details

(tick)

(tick)

(error)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

(tick)

end

(tick)

(tick)

(tick)

(error)

(tick)

(tick)

(tick)

(error)

(error)

(error)

user_params

(error)

(error)

(error)

(error)

(tick)

(tick)

(error)

(error)

(error)

(error)

EventDetails

average_speed

(error)

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(error)

(error)

data_source

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(tick)

(tick)

(tick)

distance

(error)

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(error)

(error)

duration

(error)

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(error)

(error)

correlated

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(tick)

(tick)

(tick)

estimated_length

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(error)

(tick)

(tick)

image_url

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(tick)

(tick)

(tick)

transshipment

(tick)

(tick)

(error)

(error)

(error)

(error)

(error)

(error)

(error)

(error)

entry_speed

(error)

(error)

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(error)

entry_heading

(error)

(error)

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(error)

visit_type

(error)

(error)

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

(error)

ais_class

(error)

(error)

(error)

(error)

(error)

(error)

(tick)

(error)

(error)

(error)

vendor_vessel

(error)

(error)

(error)

(error)

(error)

(error)

(error)

(tick)

(error)

(error)