Snowpipe Streaming Rowset API REST endpoints¶
The following request headers apply to all the endpoints for the Snowpipe Streaming Rowset API:
Header |
Description |
---|---|
|
auth token |
|
JWT/OAuth |
Get Hostname¶
The Get Hostname
returns the hostname used to interact with the Snowflake Rowset API product. Each account has a unique Rowset Hostname.
GET /v1/streaming/rowset/hostname
Response:
Field |
Type |
Description |
---|---|---|
status_code |
int |
Status code that customers can use to map internal errors with public documentation. |
message |
string |
Descriptive error message that explains the error when the response code is not 200 (Success). Otherwise, it’s empty for response code 200. |
hostname |
string |
The Rowset hostname of the account. |
Exchange Rowset Scoped Token¶
The Exchange Rowset Scoped Token
returns a security token that can be used to access only the Rowset API-related service. This provides security protection for the customer.
POST /oauth/token
Request:
Attribute |
Required |
Component |
Description |
---|---|---|---|
content_type |
Yes |
Header |
“application/x-www-form-urlencoded” |
grant_type |
Yes |
payload |
|
scope |
Yes |
payload |
The Rowset Hostname of the account |
Response:
Field |
Type |
Description |
---|---|---|
status_code |
int |
Status code that customers can use to map internal errors with public documentation. |
message |
string |
Descriptive error message that explains the error when the response code is not 200 (Success). Otherwise, it’s empty for response code 200. |
token |
string |
The Rowset scoped token. |
Open Channel¶
The Open Channel
operation creates or opens a new channel against a pipe or table. If the channel already exists, Snowflake bumps the client sequencer of the channel and returns the last committed offset token.
PUT /v1/streaming/rowset/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}
Request:
Attribute |
Required |
Component |
Description |
---|---|---|---|
databaseName |
Yes |
URI |
Database name, case-insensitive |
schemaName |
Yes |
URI |
Schema name, case-insensitive |
pipeName |
Yes |
URI |
Pipe name, case-insensitive |
channelName |
Yes |
URI |
The name of the channel that you create or re-open, case-insensitive |
offset_token |
No |
payload |
String used to set an offset token when opening a channel. |
requestId |
No |
Query parameter |
UUID used to track requests through the system |
Response:
Field |
Type |
Description |
---|---|---|
status_code |
int |
Status code that a customer can use to map internal errors with public documentation. For example, |
message |
string |
Descriptive error message that explains the error when the response code is not 200 (Success). Otherwise, it’s empty for response code 200. |
continuation_token |
string |
Continuation token from Snowflake; encapsulates both client and row sequencers. |
offset_token |
string |
Offset token associated with the channel if re-opening, offset token provided in the call to POST (see above), or null if the channel is being opened for the first time. |
Insert Row(s)¶
The Insert Rows
operation inserts a batch of rows to the given channel.
POST /v1/streaming/rowset/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}/rows
Request:
Attribute |
Required |
Component |
Description |
---|---|---|---|
databaseName |
Yes |
URI |
Database name, case-insensitive |
schemaName |
Yes |
URI |
Schema name, case-insensitive |
pipeName |
Yes |
URI |
Pipe, case-insensitive |
channelName |
Yes |
URI |
Channel name, case-insensitive |
continuationToken |
Yes for stateful clients, but not required for stateless clients |
Query parameter |
Continuation token from Snowflake, encapsulates both client and row sequencers |
offsetToken |
No |
Query parameter |
String used to set an offset token per batch. |
rows |
Yes |
payload |
Actual data payload that will be ingested in NDJSON format. |
requestId |
No |
Query parameter |
A UUID used to track requests through the system. |
Response:
Field |
Type |
Description |
---|---|---|
status_code |
int |
Status code that customers can use to map internal errors with public documentation |
next_continuation_token |
string |
The next continuation token from Snowflake, which encapsulates both client and row sequencers. It should be used for inserting the next batch. |
message |
string |
Descriptive error message that explains the error when the response code is not 200 (Success). Otherwise, it’s empty for response code 200. |
Drop Channel¶
The Drop Channel
operation drops a channel at server side along with its metadata.
DELETE /v1/streaming/rowset/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}
Request:
Attribute |
Required |
Component |
Description |
---|---|---|---|
databaseName |
Yes |
URI |
Database name, case-insensitive |
schemaName |
Yes |
URI |
Schema name, case-insensitive |
pipeOrTableName |
Yes |
URI |
Pipe or table name, case-insensitive |
channelName |
Yes |
URI |
Channel name, case-insensitive |
continuationToken |
No |
payload |
Continuation token from Snowflake, which encapsulates both client and row sequencers. If it’s not provided, then we will delete the channel with the latest client sequencer. |
requestId |
No |
Query parameter |
A UUID used to track requests through the system |
Response:
Field |
Type |
Description |
---|---|---|
status_code |
int |
Status code that customers can use to map internal errors with public documentation |
message |
string |
Descriptive error message that explains the error when the response code is not 200 (Success). Otherwise, it’s empty for response code 200. |
Get Channel Status¶
The Get Channel Status
operation returns the status of a channel for a specific client sequencer.
GET /v1/streaming/rowset/databases/{databaseName}/schemas/{schemaName}/pipes/{pipeName}/channels/{channelName}
Request:
Attribute |
Required |
Component |
Description |
---|---|---|---|
databaseName |
Yes |
URI |
Database name, case-insensitive |
schemaName |
Yes |
URI |
Schema name, case-insensitive |
pipeName |
Yes |
URI |
Pipe name, case-insensitive |
channelName |
Yes |
URI |
Channel name, case-insensitive |
requestId |
No |
Query parameter |
A UUID used to track requests through the system |
Response:
Field |
Type |
Description |
---|---|---|
status_code |
int |
Status code that customers can use to map internal errors with public documentation. |
message |
string |
Descriptive error message that explains the error when the response code is not 200 (Success). Otherwise, it’s empty for response code 200. |
offset_token |
String |
Latest persisted offset token |