executeSQL2
-Execute SQL
-Execute SQL in a project. Go to "Data Studio" -> "SQL Editor", write your query and then click "Export as cURL" - -![screenshot](https://raw.githubusercontent.com/sentioxyz/docs/main/.gitbook/assets/image%20(102).png) - -Find more: https://docs.sentio.xyz/docs/data-api#sql-api
- --
/api/v1/analytics/sql/execute
- -
Usage and SDK Samples
- - - -curl -X POST \
--H "Api-Key: [[apiKey]]" \
- -H "Accept: application/json" \
- -H "Content-Type: application/json" \
- "http://app.sentio.xyz/api/v1/analytics/sql/execute" \
- -d ''
-
- import org.openapitools.client.*;
-import org.openapitools.client.auth.*;
-import org.openapitools.client.model.*;
-import org.openapitools.client.api.DataApi;
-
-import java.io.File;
-import java.util.*;
-
-public class DataApiExample {
- public static void main(String[] args) {
- ApiClient defaultClient = Configuration.getDefaultApiClient();
-
- // Configure API key authorization: ApiKeyAuth
- ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
- ApiKeyAuth.setApiKey("YOUR API KEY");
- // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
- //ApiKeyAuth.setApiKeyPrefix("Token");
-
- // Create an instance of the API class
- DataApi apiInstance = new DataApi();
- AnalyticServiceSyncExecuteSQLRequest body = ; // AnalyticServiceSyncExecuteSQLRequest |
-
- try {
- analytic_service.SyncExecuteSQLResponse result = apiInstance.executeSQL2(body);
- System.out.println(result);
- } catch (ApiException e) {
- System.err.println("Exception when calling DataApi#executeSQL2");
- e.printStackTrace();
- }
- }
-}
-
- import 'package:openapi/api.dart';
-
-final api_instance = DefaultApi();
-
-final AnalyticServiceSyncExecuteSQLRequest body = new AnalyticServiceSyncExecuteSQLRequest(); // AnalyticServiceSyncExecuteSQLRequest |
-
-try {
- final result = await api_instance.executeSQL2(body);
- print(result);
-} catch (e) {
- print('Exception when calling DefaultApi->executeSQL2: $e\n');
-}
-
-
- import org.openapitools.client.api.DataApi;
-
-public class DataApiExample {
- public static void main(String[] args) {
- DataApi apiInstance = new DataApi();
- AnalyticServiceSyncExecuteSQLRequest body = ; // AnalyticServiceSyncExecuteSQLRequest |
-
- try {
- analytic_service.SyncExecuteSQLResponse result = apiInstance.executeSQL2(body);
- System.out.println(result);
- } catch (ApiException e) {
- System.err.println("Exception when calling DataApi#executeSQL2");
- e.printStackTrace();
- }
- }
-}
- Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure API key authorization: (authentication scheme: ApiKeyAuth)
-[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Api-Key"];
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Api-Key"];
-
-
-// Create an instance of the API class
-DataApi *apiInstance = [[DataApi alloc] init];
-AnalyticServiceSyncExecuteSQLRequest *body = ; //
-
-// Execute SQL
-[apiInstance executeSQL2With:body
- completionHandler: ^(analytic_service.SyncExecuteSQLResponse output, NSError* error) {
- if (output) {
- NSLog(@"%@", output);
- }
- if (error) {
- NSLog(@"Error: %@", error);
- }
-}];
-
- var SentioApi = require('sentio_api');
-var defaultClient = SentioApi.ApiClient.instance;
-
-// Configure API key authorization: ApiKeyAuth
-var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
-ApiKeyAuth.apiKey = "YOUR API KEY";
-// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
-//ApiKeyAuth.apiKeyPrefix['Api-Key'] = "Token";
-
-// Create an instance of the API class
-var api = new SentioApi.DataApi()
-var body = ; // {AnalyticServiceSyncExecuteSQLRequest}
-
-var callback = function(error, data, response) {
- if (error) {
- console.error(error);
- } else {
- console.log('API called successfully. Returned data: ' + data);
- }
-};
-api.executeSQL2(body, callback);
-
- using System;
-using System.Diagnostics;
-using Org.OpenAPITools.Api;
-using Org.OpenAPITools.Client;
-using Org.OpenAPITools.Model;
-
-namespace Example
-{
- public class executeSQL2Example
- {
- public void main()
- {
- // Configure API key authorization: ApiKeyAuth
- Configuration.Default.ApiKey.Add("Api-Key", "YOUR_API_KEY");
- // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
- // Configuration.Default.ApiKeyPrefix.Add("Api-Key", "Bearer");
-
- // Create an instance of the API class
- var apiInstance = new DataApi();
- var body = new AnalyticServiceSyncExecuteSQLRequest(); // AnalyticServiceSyncExecuteSQLRequest |
-
- try {
- // Execute SQL
- analytic_service.SyncExecuteSQLResponse result = apiInstance.executeSQL2(body);
- Debug.WriteLine(result);
- } catch (Exception e) {
- Debug.Print("Exception when calling DataApi.executeSQL2: " + e.Message );
- }
- }
- }
-}
-
- <?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure API key authorization: ApiKeyAuth
-OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('Api-Key', 'YOUR_API_KEY');
-// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Api-Key', 'Bearer');
-
-// Create an instance of the API class
-$api_instance = new OpenAPITools\Client\Api\DataApi();
-$body = ; // AnalyticServiceSyncExecuteSQLRequest |
-
-try {
- $result = $api_instance->executeSQL2($body);
- print_r($result);
-} catch (Exception $e) {
- echo 'Exception when calling DataApi->executeSQL2: ', $e->getMessage(), PHP_EOL;
-}
-?>
- use Data::Dumper;
-use WWW::OPenAPIClient::Configuration;
-use WWW::OPenAPIClient::DataApi;
-
-# Configure API key authorization: ApiKeyAuth
-$WWW::OPenAPIClient::Configuration::api_key->{'Api-Key'} = 'YOUR_API_KEY';
-# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'Api-Key'} = "Bearer";
-
-# Create an instance of the API class
-my $api_instance = WWW::OPenAPIClient::DataApi->new();
-my $body = WWW::OPenAPIClient::Object::AnalyticServiceSyncExecuteSQLRequest->new(); # AnalyticServiceSyncExecuteSQLRequest |
-
-eval {
- my $result = $api_instance->executeSQL2(body => $body);
- print Dumper($result);
-};
-if ($@) {
- warn "Exception when calling DataApi->executeSQL2: $@\n";
-}
- from __future__ import print_statement
-import time
-import openapi_client
-from openapi_client.rest import ApiException
-from pprint import pprint
-
-# Configure API key authorization: ApiKeyAuth
-openapi_client.configuration.api_key['Api-Key'] = 'YOUR_API_KEY'
-# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
-# openapi_client.configuration.api_key_prefix['Api-Key'] = 'Bearer'
-
-# Create an instance of the API class
-api_instance = openapi_client.DataApi()
-body = # AnalyticServiceSyncExecuteSQLRequest |
-
-try:
- # Execute SQL
- api_response = api_instance.execute_sql2(body)
- pprint(api_response)
-except ApiException as e:
- print("Exception when calling DataApi->executeSQL2: %s\n" % e)
- extern crate DataApi;
-
-pub fn main() {
- let body = ; // AnalyticServiceSyncExecuteSQLRequest
-
- let mut context = DataApi::Context::default();
- let result = client.executeSQL2(body, &context).wait();
-
- println!("{:?}", result);
-}
-
- Scopes
-Parameters
- - - -Name | -Description | -
---|---|
body * | -- - - - | -