REST API

DataStax Astra DB includes the Stargate, which is a data gateway deployed between client applications and a database. The REST API plugin that exposes CRUD access to data stored in Cassandra tables.

Prerequisite

  • cURL to run REST queries

If you haven’t already, create a database using Astra DB.

Before you get started, set your environment variables to save time developing on your database.

  1. In Astra DB, select the database to which you want to connect.

  2. In your Database Dashboard, select Connect.

  3. Select REST API.

    If you have multiple regions, select the region you want to connect to from the dropdown menu for instructions.

  4. Follow the steps in the prerequisites to get your application token and set up your environment variables.

  5. In your command-line interface associated with your environment, paste the following environment variables copied for your Astra DB database:

export ASTRA_DB_ID=<database_id>
export ASTRA_DB_REGION=<database_region>
export ASTRA_DB_KEYSPACE=<keyspace_name>
export ASTRA_DB_APPLICATION_TOKEN=<app_token>

Now you are ready to get started:

To view the API Reference, see Astra DB REST API.

Using Postman

If you prefer, you can use Postman as a client interface for exploring REST APIs (download here). We’ve provided a Stargate REST API Postman Collection that you can import in Postman to play with the examples shown in this walkthrough.

Now you’re ready to use the REST API for CRUD operations.