Call APIs From the Docs
You can now use these API docs to directly execute API calls
Typically when you interact with Space and Time, you'll do so through one of our provided interfaces: the Space and Time Studio, a JDBC driver, REST APIs, SDKs, or CLI terminal calls. But sometimes, you just want to make quickly make an API call to better understand what it produces. This can now be done directly from the Space and Time docs. Like many other guides, this page will show you the easiest way to make docs-embedded API calls, although not the only way.
How to Call APIs from the Docs with Access Token
Copy Your Access Token
Almost every API call will require a valid access token, which is the local key to your network session. The simplest way to get yours is by logging into the Space and Time Studio. You can also generate an access token by following the REST APIs authentication workflow, the CLI workflow, or the JDBC workflow. If you choose one of these options, skip ahead to the next step.
Copy from Space and Time Studio
- Navigate to Space and Time Studio: https://app.spaceandtime.ai/.
- Click on the "Sign in" button in the upper right, and enter your UserID and Password.
- Click on "My Account" in the upper righthand corner (replaces "Sign In") and make sure you're on the "My Accounts" tab.
- Scroll down to find a box containing your session's active
Access_Token
, which you can copy by clicking the copy icon.
Open API Docs
The access token page above has a button that will open the docs, or you can navigate directly via: https://docs.spaceandtime.io/reference/about-rest-apis
For example, we'll click down to the "Resource Discovery REST APIs," so we can run the Discover Tables API: https://docs.spaceandtime.io/reference/discover-table
Paste Access_Token Into Docs
On any docs API reference page, below the language options, you'll see a section labeled "Authorization" with a text box below for a "Bearer" token.
Clear out that Bearer text box and paste in the Access_Token
you copied from above.
The docs page will save your token for your session if allowed.
Try Out the API!
That's it! You should be able to add any parameters to the API page and click on the "Try It!" button at the bottom of the code snippet.
The API return data will be displayed immediately below the code snippet, along with the status code from the API. For example, the image here shows the response for the "discover-table" API, set to look for "All" tables within Schema "SXTDemo" with no filters.
Give it a try!
How to Call Gateway (Secrets Proxy) APIs with an API Key
Some of the REST APIs can be called from the docs using an API key instead of an Access_Token
. Check out the API Key Quick Start Guide to see how.
Updated about 1 year ago