💫

Connect to any API: GET request for lists

The Data Library allows you to create API requests to any database or tool with an available REST API.

Here is how to create a GET request to retrieve data to be displayed in your apps.

💡

If you are connecting to Airtable, you can use the Airtable API Wizard to automatically set up GET requests for you.

💡

You can utilise other API verbs (i.e. POST) to retrieve data if your API specifies otherwise. Simply change the verb type of the request URL.

Example Data

Use this request URL to get sample data for the example below.

https://example-data.draftbit.com/books

How to create a GET request

  1. In Data Library, click + New Collection and select Custom API.
  2. image

  3. Enter the name of your collection and an optional description (we recommend putting the source as the description, like Google Sheet).
  4. 💡

    A Collection is a group of API requests, normally from the same data source.

    image

  5. You're ready to create requests! First, edit the request name to help you identify it.
  6. image

  7. Input the GET request URL from the API of your choosing. (Or use the example request we listed above)
  8. image

  9. If the API has Headers or Parameters values you need to input in order to send the request call, input them in the section below. (The example request does not require any extra input)
  10. 💡

    Often, if the API requires an API key, you need to input it under Headers or Authentication in the collection settings.

    For example, this is what you need to put for Airtable requests.
    For example, this is what you need to put for Airtable requests.

  11. Press Send. You will receive a response list of all the data retrieved from the API request. You have successfully retrieved data from an API! 🎉
  12. image
    💡

    If you encounter any error message after clicking Send, screenshot it and post it in the Bravo Community or send it to us from the ? button at the bottom right corner.

How to select data points to use in your apps

In your response list under Received Data, you will see all the data points that the API request is sending over.

The text in light gray is the name of the data point. The text in green is sample text content of the data point, and text in pink is sample numerical content.

  1. If you are selecting data that you want to populate into a list in your design, first select All where you see a dropdown option. This selects the array (list) of data rather than one data record.
  2. If you are not selecting a list of data, skip to Step #2.

    image

  3. Next, check the box next to all the data points that you want to bind to your app design. Any data you select here will appear as an option to bind in Data Binding.
  4. image

3. Under Selected Data, it lists all the data points you have selected and automatically denotes the one(s) that is an array.

Data: the name of the data point sent from the API. We don't recommend editing this unless you know what you're doing.

Label: the name to easier identify the data point. It appears in Data Binding, and you may also edit this for certain request setups.

Sample Content: sample content of the data point. This sample content will also be the placeholder content for any fields that come up blank. You can delete it if you don't want to override any blank fields.

image