How to integrate with Snowflake

Snowflake’s is a cloud computing–based data cloud company based in Bozeman, Montana. The firm offers a cloud-based data storage and analytics service, generally termed “data-as-a-service”.

Snowflake’s Integration Requirements

Before setting up your integration, you need the following parameters from Snowflake:

You have to follow these instructions to create an O auth application in snowflake

Snowflake account URL.

For example, https://myorg-account_xyz.snowflakecomputing.com/oauth/token-request. is the snowflake token request URL  ie myorg-account_xyz is the account title

– ClientID

– Client Secret

– Scope, scope=refresh_token

Snowflake SQL API

We will use Snowflake SQL API to store the data from Digioh.

1- The following API Endpoint will be used in Digioh.

https://<account_identifier>.snowflakecomputing.com/api/v2/statements

Note:  <account_identifier> will be replaced with your snowflake account title

2- Sample Request Body:

{
  "statement": "select * from T where c1=?",
  "timeout": 60,
  "database": "TESTDB",
  "schema": "TESTSCHEMA",
  "warehouse": "TESTWH",
  "role": "TESTROLE",
  "bindings": {
    "1": {
      "type": "FIXED",
      "value": "123"
    }
  }
}


In the body of the request in the example above:

  • The statement field specifies the SQL statement to execute.The statement includes a bind variable (the question mark in ci=?), which evaluates to the first binding (1) specified in the bindings field.
  • The timeout field specifies that the server allows 60 seconds for the statement to be executed.
  • The database, schema, warehouse and role fields specify that the TESTDB database, TESTSCHEMA schema, TESTWH warehouse, and TESTROLE role should be used when executing the statement.

Note: Edit the JSON as needed.

That’s all Your Snowflake integration is ready to go!

If you have questions about setting up your Snowflake integration, send us an email, and we’ll be glad to help!