REST API

Astra 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 DataStax Astra.

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

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

  2. In your Database Dashboard, select Connect.

  3. Select REST API.

  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 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 DataStax Astra 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.