The Superblocks REST API lets you create a custom integration to any internal or third-party HTTP based API. Use this integration to configure your API, including base URL for different servers, API authentication, and OpenAPI specifications, so your team can make REST requests in seconds in any Superblocks backend API.
Setting up REST API
- In the web app, navigate to the Integrations page
- Click on the REST API tile
- Name your REST API
- Set your API's Base URL
- Set up Authentication for your API
- Add Headers and Query parameters that will be injected into each request for this API
- Click Upload OpenAPI to upload a specification for your API. Learn more in API Specifications
- Optionally, add more configurations to use a different Base URL or authorization credentials for different environments
- Click Create
Fetch Credentials Dynamically
Note, if you need to retrieve credentials on demand with a custom workflow instead of using the pre-built authentication flows, enable "Fetch credentials dynamically". This allows you to run a Superblocks Workflow (which can issue an API call or connect to a secrets manager) to fetch the token and return it for use within your REST API integration form:
Screenshot of Fetch Credentials Dynamically
You can upload an existing OpenAPI specification file for your REST API. OpenAPI specs helps your team develop at lighting speed in Superblocks. You'll get access to interactive docs, autocomplete in REST request forms, data validation, and more when your provide a specification for your API.
Uploading an OpenAPI specification
- Select Upload OpenAPI in the top-right corner
- From the uploader, select a JSON or YAML file containing your API's OpenAPI spec (version 2.0 or later)
- Click Ok to upload
Once your API's spec has been uploaded, you can manage your spec and explore docs from the API Specification tab.
Replacing an OpenAPI specification
To replace an API specification, such as to upload a new version, you can click on the button in the top-right labeled with the name of specification, e.g.
spec-name.yaml, and upload a new specification.
Creating REST steps
Once your REST integration is configured, you can create REST steps to easily interact with the API. See building REST requests for more in depth details.
Supported OpenAPI specifications
Superblocks supports uploading the following specification versions:
- OpenAPI 3.0 and 3.1
- Swagger 2.0
Specification files can be provided in any of the following formats: