API Reference

This section provides access to the autogenerated Swagger UI built off of the Skylight API.

How to use the API reference

This Swagger UI allows us to test out Skylight API calls straight from the browser. To do this, we'll need to do the following:

  1. Retrieve API credentials.
  2. Call the Authentication endpoint.
  3. Copy the Access Token.
  4. Use the Access Token for other calls.

Retrieve API credentials

To retrieve a new set of API credentials, follow the instructions here. After retrieving these credentials, be sure to keep it in a secure location.

Call the Authentication endpoint

Now that we have our API credentials, we can retrieve an Access Token from Skylight. To do this (and to test out our first API call), go to the Authentication Swagger UI here.

Image of Authentication Swagger UI

The Authentication Swagger UI should look something like this.

Then click on the POST for the /login/realms/{realm} request to open up the information for that request to view the request parameters and response examples.

Image of Login Swagger UI

The information for the login request will look like this.

Click on Try it out and fill in the Realm field with the domain name from the credentials. Replace the strings in the JSON body for username and password using the values from the API credentials.

Image of Login Swagger UI

Fill in the Realm/Username/Password fields.

Once the Realm/Username/Password fields are filled out, click on Execute. This will run the API call and show the body of the response from the Skylight API below in JSON format.

Copy the Access Token

In the response body of this authentication call, there is a key for a field called access_token. Copy this long string (without the quotation marks) and store it in a safe location. This token will be used to make other Skylight API calls.

Use the Access Token for other calls

Now that we have an Access Token, we can make Skylight API calls. As an example, let's request information about media stored on the domain that is accessible to us.

Go to the Files tag under Media section, and click on the GET request for /files.

Click on Try it out. There are many parameters that can be configured; for now, we'll ignore them and scroll down to the Authorization field. Enter the Access Token from the previous step and then click on Execute. Scroll down to see information about the request that was made and the response.