Data Warehouse

Tutorial Videos

API

Storage and Compute

Data Sources

CDC Setup

Transform

KPI

Models
Segments

Dashboard

Drill Down

Explores

Machine Learning

Sharing

Scheduling

Notifications

View Activity

Admin

Launch On Cloud

FAQs

FAQ's

Security

Feedback

Option to take feedback from UI

Release Notes

Release Notes

Export API's

Models

Segments

1. Download Explore Report

Downloads result in CSV format, first row having column headers.

/api/v0.4/explore/streamresult/<EXPLORE_ID>

Method: GET
Authentication: Basic
Username: API Key
Password: API Secret
  • Sample Request https://<hostname>/api/v0.4/explore/streamresult/1491b5e97ded45e5957387c0039fa7ee    

2. Download Segment Report

Downloads result in CSV format, first row having column headers.

/api/v0.4/segment/streamresult/<SEGMENT_ID>

Method: GET
Authentication: Basic
Username: API Key
Password: API Secret
  • Sample Request https://<hostname>/api/v0.4/segment/streamresult/0964bd744703488aa1fd83937bb3ad1

3. Get Explore Report Update Time

Get the report updated time

/api/v0.4/explore/successtime/<EXPLORE_ID>

Method: GET
Authentication: Basic
Username: API Key
Password: API Secret

4. Get Segment Report Update Time

Get the report updated time

/api/v0.4/segment/successtime/<SEGMENT_ID>

Method: GET
Authentication: Basic
Username: API Key
Password: API Secret

5. Get latest Explore output location

It will give the location of the output i.e. S3 or any other storage

url='https://<host>/api/v0.4/report/outputlocation/explore/<EXPLORE_ID>'
username=API Key
password=API Secret
r=requests.get(url, auth=(username,password)

6. Get latest Segment output location

It will give the location of the output i.e. S3 or any other storage

url='https://<host>/api/v0.4/report/outputlocation/segment/<SEGMENT_ID>'
username=API Key
password=API Secret
r=requests.get(url, auth=(username,password))

7. Get explore id and names in a folder

It will give the list of explore id and names in a particular folder

url='https://<host>/api/v0.4/explores/infoByFolder/<SPACE_ID>'
username=API Key
password=API Secret
r=requests.get(url, auth=(username,password))

8. Get folder id and names in an organization

It will give the list of folder(space) id and names in an organization.

url='https://<host>/api/v0.4/folders/byOrgName/<ORG_NAME>'
username=API Key
password=API Secret
r=requests.get(url, auth=(username,password))

import requests
from requests.auth import HTTPBasicAuth

auth =  HTTPBasicAuth(<API_KEY>, <API_SECRET>)
response = requests.get("https://<hostname>/api/v0.4/explore/streamresult/<EXPLORE_ID>", auth)

print(response.content)

library('httr')

username = '<API KEY>'
password = '<API SECRET>'

temp = GET("https://<hostname>/api/v0.4/explore/streamresult/<EXPLORE ID>",
           authenticate(username,password, type = "basic"))

temp = content(temp, 'text')
temp = textConnection(temp)
temp = read.csv(temp)

/*Download the Data*/

filename resp temp;
proc http
url="https://<hostname>/api/v0.4/explore/streamresult/<EXPLORE ID>"
   method= "GET"  
   WEBUSERNAME = "<API KEY>"
   WEBPASSWORD = "<API SECRET>"
   out=resp;
run;

/*Import the data in to csv dataset*/
proc import
   file=resp
   out=csvresp
   dbms=csv;
run;

/*Print the data */
PROC PRINT DATA=csvresp;
RUN;

import requests
import json

url='http://hostname/api/v0.4/createCSV'

username='API_KEY'
password='API_SECRET'

files={'file':open('FILE_PATH.csv','rb')}
values={'projectname':PROJECT_NAME','name':'CSV_DATASOURCE_NAME'}

r=requests.post(url, files=files, data=values, auth=(username,password))

res_json=json.loads(r.text)

print(res_json['success'])

import requests
import json

url='http://hostname/api/v0.4/updateCSV'

username='API_KEY'
password='API_SECRET'

files={'file':open('FILE_PATH.csv','rb')}
values={'projectname':PROJECT_NAME','name':'CSV_DATASOURCE_NAME'}

r=requests.post(url, files=files, data=values, auth=(username,password))

res_json=json.loads(r.text)

print(res_json['success'])

import requests

url='https://<hostname>/api/v0.4/explore/streamresult/<EXPLORE ID>'

username='API_KEY'
password='API_SECRET'

r=requests.get(url,auth=(username,password))
print(r)
print(r.text)

import requests
import pandas as pd

url='https://<hostname>/api/v0.4/explores/infoByFolder/<SPACE_ID>'

username='API_KEY'
password='API_SECRET'

r=requests.get(url,auth=(username,password)).json()
df = pd.DataFrame(r)
print(df)

import requests
import pandas as pd

url='https://<hostname>/api/v0.4/folders/byOrgName/<ORG_NAME>'

username='API_KEY'
password='API_SECRET'

r=requests.get(url,auth=(username,password)).json()
df = pd.DataFrame(r)
print(df.loc[:,['name','id']])

import requests

import pandas as pd

import io

url='https://<hostname>/api/v0.4/explore/streamresult/<EXPLORE ID>'

secret='API_SECRET'

r=requests.get(url,headers = {'Authorization': 'SprinkleUserKeys ' +secret } )

df = pd.read_csv(io.StringIO(r.text),sep=',')

import requests

import pandas as pd

import io

url='https://<hostname>/api/v0.4/segment/streamresult/<SEGMENT ID>'

secret='API_SECRET'

r=requests.get(url,headers = {'Authorization': 'SprinkleUserKeys ' +secret } )

df = pd.read_csv(io.StringIO(r.text),sep=',')

import requests

import json

url='http://hostname/api/v.o4/createCSV'

files={'file':open('path/file.csv’')}

values={'projectname':PROJECT_NAME,'name':'csv_datasource_name/table_name'}

secret='API_SECRET'

r=requests.post(url, files=files, data=values, headers = {'Authorization': 'SprinkleUserKeys ' +secret } )

res_json=json.loads(r.text)

import requests

import json

url='http://hostname/api/v.o4/updateCSV'

files={'file':open('path/file.csv’')}

values={'projectname':PROJECT_NAME,'name':'csv_datasource_name/table_name'}

secret='API_SECRET'

r=requests.post(url, files=files, data=values,headers = {'Authorization': 'SprinkleUserKeys ' +secret } )

res_json=json.loads(r.text)