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 April 2, 2022 2023 and April 2, 20222023. 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://api.skylight.earth/schema/query.doc.html
Getting Started
Download and install Postman
Download and open the sample file
Running the Query
After opening Postman, click on Collections and import the *.postman_collection.json. You will see the GraphQL collection added to the list. Note, you will need to have a GraphQL environment set up in Postman for the variables to pass automatically.
...
Query Break Down
For each query, the value for the {{base_url}} is https://api.skylight.earth. Note: we recommend to set {{base_url}} as an environment variable so that you can pass in this variable or any variables automatically. Documentation on how to setup, manage and access environment variable for your queries can be found here.
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 April 1, 2022 2023 and April 2, 20222023. 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:
...