CREATE API_TOKEN

Syntax

CREATE API_TOKEN api_token_name;

Description

An API_TOKEN can be used for automated systems to access Deltastream. A token must be renewed every 90 days.

When an API_TOKEN is used it assumes all organizations, roles, and priviledges of the creator.

Arguments

api_token_name

This specifies the name of the new API_TOKEN. The name is only used for managing(LIST/DROP) the token.

Examples

Create a new API_TOKEN

The following creates an API_TOKEN named my_token.

<no-db>/<no-store># CREATE API_TOKEN my_token;
                                                                                                                                                                                                   Token                                                                                                                                                                                                   
------------------------------------------------------------------------------------------------------------------------------------------------------------
  [eyJhbGciOiJFUzI1NiIsImtpZCI6MywidHlwIjoiSldUIn0nnnnnnnnDc1NDgxODZjNjY1ZCJ9.1HBA3bumlFsJxFu2ZqBnsBEEunyF_RoeGZcdbRwnlkeaOEXBoRf4X2_Iy3nvCrIZgk3_ZR8E-WECFS7ut94oGw  ]

Use an API_TOKEN with cli

~$ /deltastream-cli -a [my-access-token]
API version: (dsql 4.4.0, server 4.4.0)
connected as 'sales@deltastream.io' with default database `mydb`, schema `public`, and store `prod`.
mydb.public/prod# 

Use an API_TOKEN with cli - env property

~$ DS_TOKEN=[my-access-token]
~$ /deltastream-cli
API version: (dsql 4.4.0, server 4.4.0)
connected as 'sales@deltastream.io' with default database `mydb`, schema `public`, and store `prod`.
mydb.public/prod# 

Last updated