How to authenticate Swagger

Anton Kovalsky
  • Updated

 

All instructions related to Swagger require you to first authenticate yourself whenever you’ve opened a window with the Swagger UI. Below are detailed instructions on how to make sure you are fully authenticated when using Swagger API functions.

When does authorization expire?

Opening new tabs, running into errors/failures, refreshing your page, or letting enough time go by can all cause your authentication to expire. If you're getting errors (especially 401 errors or any kind of "unauthorized" errors), try to re-authenticate using the instructions below.

Step 1. Authenticate your credentials on Swagger

1.1. Go to the Swagger UI page for the service that you want to access via API.
Note that there are separate Swagger pages for things like notebooks or the Terra Data Repository.

You'll find the API endpoints for the Terra Data Repository (where you'll find the commands necessary for ingesting data) at https://data.terra.bio/swagger-ui.html. For notebooks, API commands for doing things like creating or deleting virtual machines or persistent disks can be found at notebooks.firecloud.org.

Getting errors and failures using Swagger? If you're already using Swagger, and you notice you're starting to get a lot of errors and failures, try refreshing the page, and continue following these instructions.

1.2. Click the Authorize button at the left, near the top of the page.
Swagger_Find-authorize-button_Screenshot.png

1.3. Check off all of the boxes at the bottom of the pop-up and click "Authorize" again.

Swagger_Available-authorizations_Screenshot.png

1.4. If asked, select the email associated with the billing project that you'll be using to create the cloud environment.

After you've clicked "Authorize" and selected your login credentials (you may be asked for a password), you'll see the pop up below. Make sure to click "close" and not "log off" to stay authenticated as you execute the API functions.

Swagger_Close-authorization-popup_Screenshot.png

Step 2. Execute API functions

You can now use the API functions listed on the page, assuming the email you authenticated with has access to Terra resources.

2.1. Select the function of interest to de-collapse the details

2.2. Click "Try it out" to activate the fields.

2.3. Fill in the request body and other fields.

2.4. Click "Execute."  

Sep-23-2021_02-14-04.gif

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.