Skip to content
You're viewing documentation for Draftbit Classic (v1), our previous platform. See the current Draftbit docs.

REST API Services

REST APIs allow you to connect your app to a server or backend using standard HTTPS

You can manage all your API services in the API & Cloud Services modal accessible from the option in the left menu bar of the Builder.

Apart from adding a custom REST API service, Draftbit supports various services such as Xano, Supabase, Backendless, Airtable and more as well. Just about any REST-like API that sends and receivesJSON is compatible with Draftbit.

Once you have added an API service, you can then create Endpoints for that connection to use with API Request Actions and Fetch components throughout your app

Click on one of the available options on the left to begin configuring a new service.

You can also copy an existing configured Service from another app using the Copy from another app button in the left panel.

This will import the Service and all of it’s associated REST API Endpoints

Use the configuration options to set up your new API service.

Here you can set the Name and Base URLs for your new API service. In this example, https://api.example.com is the base URL for the API and /posts/123 is the endpoint path.

If you were setting up a new connection to the above example API, our Base URL would be https://api.example.com.

When you create Endpoints for this new service, you can use the specific path to get a post by its id using {{variable}} formatting, for example /posts/{{id}}. You’ll be able to pass values to any variables that you create on the Service’s Endpoints when using an API Request Action or Fetch component in your app.

PropertyDescriptionExample
NameA name for this connectionXano API
Dev URLThe base URL that will be used while developing in the Builder and when publishing using the Development Environmenthttps://xxxx-yyyy-zzzz.a1.xano.io/api:abc123
Prod URLThe base URL that will be used when publishing using the Production Environmenthttps://xxxx-yyyy-zzzz.a1.xano.io/api:abc123
Configuration ModeYou can either create your endpoints manually, or import from an OpenAPI schema. See OpenAPI Spec section below for more.Manual or OpenAPI

This section is enabled when you have chosen OpenAPI for the service’s Configuration Mode.

The OpenAPI Specification allows an API to provide a description of itself encoded in a JSON document. If your API provides an OpenAPI schema, Draftbit can use that to automatically create the Endpoints for the API service, and keep them updated, so you don’t have to manage them manually.

PropertyDescription
Schema URLA URL which can be accessed with a GET request, which returns your OpenAPI schema.
Refresh IntervalYou may configure your schema to be automatically refreshed at regular intervals. You can always re-fetch your schema manually using the Fetch Schema button.
HeadersInclude any headers needed to fetch your schema. For example, if your schema endpoint requires authentication you might need an Authorization header.

If you need to set custom HTTP headers for ALL Endpoints that will be associated with this Service, you can set them here. If you only need to set HTTP headers for specific Endpoints, you can set those up when creating the Endpoints.

You can type a value directly into the value field or select a variable that you’ve created from the dropdown.

PropertyDescriptionExample
KeyThe HTTP header nameX-APP-ID
ValueThe value associated with the headerx1y2z3

To edit an API Service created previously, click on the service from your list of services.

To duplicate a Service, click the overflow menu (...) for the service you want to duplicate and then click Duplicate.

To delete a Service, click the overflow menu (...) for the service you want to delete and then click Delete.