Common setup for Snowflake REST APIs tutorials¶
Introduction¶
This topic provides instructions for the common setup required for all Snowflake REST APIs tutorials available in this documentation.
Overview of the Snowflake REST APIs¶
Before starting your setup, take a look at the Snowflake REST APIs. The following table lists the available APIs:
API |
Description |
---|---|
|
Manages Snowflake compute pools. |
|
Sends data questions to Cortex Analyst. |
|
Performs LLM text completion inference. |
|
Queries a Cortex Search Service. |
|
Manages Snowflake databases. |
|
Manages Snowflake dynamic tables. |
|
Manages Snowflake functions. |
|
Manages Snowflake grants. |
|
Manages Snowflake image repositories. |
|
Manages Snowflake roles. |
|
Manages Snowflake schemas. |
|
Manages Snowflake services. |
|
Manages Snowflake stages. |
|
Manages Snowflake tables. |
|
Manages Snowflake tasks. |
|
Manages Snowflake users. |
For a complete list of the APIs currently available, see the Snowflake REST APIs reference documentation.
Import the Snowflake REST APIs collections¶
This tutorial walks you through the process of importing the Snowflake REST APIs collections from Postman.
Download the API collections from the Git repository into a folder.
Open the Postman application, and create an account, if necessary.
In Postman, open the desired workspace.
Select Import.
Select folders.
In the dialog, select the folder where you extracted the collection, and select Open.
Verify that all of the items are selected, and select Import.
You should see the collections listed in the left panel, as shown:
Specify the bearer token in Postman¶
REST requests require a JWT token in the request header to authenticate the request. In Postman, you can copy the JWT token into the bearerToken
header property, as shown.
You can then set the x-snowflake-authorization-token-type
key to KEYPAIR_JWT
in each request header, as shown:
Note
If you prefer writing Python applications, you can use the Snowflake Python APIs to manage Snowflake objects. For more information, see Snowflake Python APIs: Managing Snowflake objects with Python.
Set environment variables in the Postman environment¶
You can set environment variables in your Postman environment. You can then use these variables in Postman, in the form {{variable_name}}
.
All endpoint URLs begin with a baseURL
, which identifies your Snowflake account. The baseURL has the form: <account_locator>.snowflakecomputing.com
, where <account_locator>
is your Snowflake account name.
To set the baseURL
variable, as well as any other variables, in Postman, enable each parameter and set its value, as shown:
For each value you set, you must select Save to save the new value.
What’s next?¶
Congratulations! In this tutorial, you learned the fundamentals for managing Snowflake database, schema, and table resources using the Snowflake REST APIs.
Summary¶
Along the way, you completed the following steps:
Create and list databases.
Create and list schemas.
Create a table and fetch the table details.
Alter a table and fetch the table details.
List available tables.
Next tutorial¶
You can now proceed to Tutorial 2: Create and manage tasks, which shows you how to create and manage Snowflake tasks.