Wednesday, May 11, 2016

Quick Introduction to RESTful APIs in StatsPanda.com

StatsPanda.com is largely RESTful API based Data Visualisation Application. Every service on StatsPanda can be used using REST API invocation leading to creation of Charts, Graphs & Dashboard. In fact, by design, the web application has not provided user interfaces for many of the services like Creating Charts, Creating Dashboards, Importing data etc.

There are different types of APIs 
  • API to get info on the API itself 
  • API to create a Chart or Graph & other core functions  
  • API to get API JSON Input or Data File info
  • API to update a Chart or Graph 
  • API to delete a Chart or Graph 
For an end users, here are the set APIs by various activities -

1. Upload a data file and then use set of READ ( list & details) and DELETE APIs

2. Data Connector APIs import data from uploaded files or other data storage sources into StatsPanda to create Data Sources. CREATE, READ (list and details) & DELETE APIs are available.

3. Use the Datasource created in step#2 or static data to create Charts. CREATE, READ (list and details), UPDATE & DELETE operations supported.

4. Finally use the Dashboard APIs to stitch the charts created in step#3 and create a dashboard. CREATE, READ (list and details), UPDATE & DELETE operations supported.

For actual file upload, use the Web Interface. Rest of the activities can be completed using the APIs listed below.


// #######################   File Uploads   ######################//

|---------------------------------------------------------------|
|  File Uploads APIs
|---------------------------------------------------------------|

CREATE

No create API. Actual file upload happens using the web interface.



|---------------------------------------------------------------|
|  Fetches the list of Uploaded Files
|---------------------------------------------------------------|

GET:    /apiinput/fileuploads
GET:    /apiinput/fileuploads/organization/:orgId
GET:    /apiinput/fileuploads/organization/:orgId/user/:userName

|---------------------------------------------------------------|
|  Gets the details of API Inputs as persisted
|---------------------------------------------------------------|


GET:    /apiinput/fileuploads/:uniqueKey
GET:    /apiinput/fileuploads/organization/:orgId/:uniqueKey
GET:    /apiinput/fileuploads/organization/:orgId/user/:userName/:uniqueKey


API Input:

GET:    /apiinput/fileuploads/json/:uniqueKey/action/getapiinput
GET:    /apiinput/fileuploads/json/organization/:orgId/:uniqueKey/action/getapiinput
GET:    /apiinput/fileuploads/json/organization/:orgId/user/:userName/:uniqueKey/action/getapiinput

UPDATE

No Update APIs


DELETE
/apiinput/fileuploads/:uniqueKey
/apiinput/fileuploads/organization/:orgId/:uniqueKey


// ###############################################################//


// ########################   Datasource   #######################//

|---------------------------------------------------------------|
|  Get the details about the API i.e. API documentation
|---------------------------------------------------------------|

GET: /datasource/connector/json
GET: /datasource/connector/csv
GET: /datasource/connector/excel
GET: /datasource/connector/google/sheet

|---------------------------------------------------------------|
|  Create the Datasource
|---------------------------------------------------------------|

POST: /datasource/connector/json
POST: /datasource/connector/csv
POST: /datasource/connector/excel
POST: /datasource/connector/google/sheet

|---------------------------------------------------------------|
|  Url for viewing the Datasource
|---------------------------------------------------------------|

UI: /ui/charts/datasource/data-table?unique_key=:uniqueKey
UI: /ui/charts/datasource/data-table?organizationId=:orgId&unique_key=:uniqueKey


NO PUT


|---------------------------------------------------------------|
|  Fetches the list of charts
|---------------------------------------------------------------|

GET /apiinput/datasource/json


GET /apiinput/datasource/excel/organization/:orgId

GET /apiinput/datasource/sheet/organization/:orgId/user/:userName


|---------------------------------------------------------------|    


|  Gets the details of API Inputs as persisted, used for Edit
|---------------------------------------------------------------|

GET /apiinput/datasource/json/:uniqueKey (X)


GET /apiinput/datasource/excel/organization/:orgId/:uniqueKey


GET /apiinput/datasource/sheet/organization/:orgId/user/:userName/:uniqueKey

|---------------------------------------------------------------|


| READs only the Data
|---------------------------------------------------------------|

GET /apiinput/datasource/json/:uniqueKey/action/getdata
GET /apiinput/datasource/excel/organization/:orgId/:uniqueKey/action/getdata
GET /apiinput/datasource/sheet/organization/:orgId/user/:userName/:uniqueKey/action/getdata


|---------------------------------------------------------------|


| READs the Datasource API Input: 
|---------------------------------------------------------------|


GET: /apiinput/datasource/json/:uniqueKey/action/getapiinput
GET: /apiinput/datasource/excel/organization/:orgId/:uniqueKey/action/getapiinput
GET: /apiinput/datasource/sheet/organization/:orgId/user/:userName/:uniqueKey/action/getapiinput


|---------------------------------------------------------------|




| DELETEs the Datasource API Input: 
|---------------------------------------------------------------|

DELETE: /apiinput/datasource/json/:uniqueKey
DELETE: /apiinput/datasource/excel/organization/:orgId/:uniqueKey



// ###############################################################//


// ########################## CHARTS  ###########################//


|---------------------------------------------------------------|
|  Get the details about the API i.e. API documentation
|---------------------------------------------------------------|


GET: /charts/morris/bar-chart


|---------------------------------------------------------------|
|  Create the Chart
|---------------------------------------------------------------|

POST: /charts/morris/bar-chart


|---------------------------------------------------------------|
|  Url of a Chart
|---------------------------------------------------------------|

UI: /ui/charts/morris/bar-chart?unique_key=
UI: /ui/charts/:orgId/morris/bar-chart?unique_key=


|---------------------------------------------------------------|
| Used for building the Charts, it fetches only the jsonInput Data
|---------------------------------------------------------------|

GET: /apiinput/charts/morris/bar-chart/:uniqueKey/jsoninput/data
GET: /apiinput/charts/:orgId/morris/bar-chart/:uniqueKey/jsoninput/data


|---------------------------------------------------------------|
|  Fetches the list of charts
|---------------------------------------------------------------|

GET: /apiinput/charts/bar-chart
GET: /apiinput/charts/bar-chart/:orgId
GET: /apiinput/charts/bar-chart/:orgId/:userName

|---------------------------------------------------------------|    
|  Gets the details of API Inputs as persisted, used for Edit
|---------------------------------------------------------------|

GET: /apiinput/charts/morris/bar-chart/:uniqueKey/apiinput/json
GET: /apiinput/charts/:orgId/morris/bar-chart/:uniqueKey/apiinput/json


|---------------------------------------------------------------|
|  Update the API input, used to save an updated chart
|---------------------------------------------------------------|

PUT: /apiinput/charts/morris/bar-chart/:uniqueKey/apiinput/json
PUT: /apiinput/charts/:orgId/morris/bar-chart/:uniqueKey/apiinput/json


|---------------------------------------------------------------|
|  Delete a chart
|---------------------------------------------------------------|

DELETE: /apiinput/chart/:uniqueKey
DELETE: /apiinput/:orgId/chart/:uniqueKey


// ###############################################################//


// ######################### DASHBOARD ##########################//


|---------------------------------------------------------------|
|  Get the details about the API i.e. API documentation
|---------------------------------------------------------------|

GET: /dashboard



|---------------------------------------------------------------|
|  Create the Dashboard
|---------------------------------------------------------------|

POST: /dashboard



|---------------------------------------------------------------|
|  Url of a Dashboard
|---------------------------------------------------------------|

UI: /ui/dashboard/new-public-dashboard?unique_key=:uniqueKey
UI: /ui/dashboard/:orgId/new-dashboard?unique_key=:uniqueKey


|---------------------------------------------------------------|
| Used for retrieving the Dashboard jsonInput Data
|---------------------------------------------------------------|

GET: /apiinput/dashboard/:uniqueKey/jsoninput/data
GET: /apiinput/dashboard/:orgId/:uniqueKey/jsoninput/data


|---------------------------------------------------------------|
|  Fetch the list of Dashboards
|---------------------------------------------------------------|

GET: /apiinput/dashboard
GET: /apiinput/dashboard/:orgId
GET: /apiinput/dashboard/:orgId/:userName


|---------------------------------------------------------------|    
|  Get the details of API Inputs as persisted, used for Edit
|---------------------------------------------------------------|

GET: /apiinput/dashboard/:uniqueKey/apiinput/json
GET: /apiinput/dashboard/:orgId/:uniqueKey/apiinput/json


|---------------------------------------------------------------|
|  Update the API input, used to save an updated Dashboard
|---------------------------------------------------------------|


PUT: /apiinput/dashboard/morris/bar-chart/:uniqueKey/apiinput/json
PUT: /apiinput/dashboard/:orgId/morris/bar-chart/:uniqueKey/apiinput/json


|---------------------------------------------------------------|
|  Delete a Dashboard
|---------------------------------------------------------------|

DELETE: /apiinput/dashboard/:uniqueKey
DELETE: /apiinput/dashboard/chart/:uniqueKey

// ###############################################################//


// ######################### STATISTICS ##########################//

|---------------------------------------------------------------|
|  Get the details about the API i.e. API documentation
|---------------------------------------------------------------|

GET:  /stats/descriptive
GET:  /stats/regression
GET:  /stats/regression/multiregression/OLS
GET:  /stats/regression/multiregression/GLS
GET:  /stats/ranking
GET:  /stats/covariance
GET:  /stats/correlation/pearsons
GET:  /stats/correlation/spearmans
GET:  /stats/correlation/kendalls


GET:  /stats/chisquare/statistic
GET:  /stats/chisquare/p-value
GET:  /stats/chisquare/goodness-of-fit
GET:  /stats/onewayanova/f-value
GET:  /stats/mann-whitney-u/statistic
GET:  /stats/mann-whitney-u/p-value
GET:  /stats/wilcoxon-signed-rank/statistic
GET:  /stats/wilcoxon-signed-rank/p-value

|---------------------------------------------------------------|
|  Fetch the list of Statistics API Calls
|---------------------------------------------------------------|

GET:    /apiinput/stats
GET:    /apiinput/stats/organization/:orgId
GET:    /apiinput/stats/organization/:orgId/user/:userName

|---------------------------------------------------------------|    


|  Get the details of Statistics API Calls Inputs as persisted
|---------------------------------------------------------------|

GET: /apiinput/stats/:uniqueKey
GET: /apiinput/stats/organization/:orgId/:uniqueKey
GET: /apiinput/stats/organization/:orgId/user/:userName/:uniqueKey

|---------------------------------------------------------------|    


|  Get the details of API Inputs and Output Data as persisted 
|---------------------------------------------------------------|

/apiinput/stats/json/:uniqueKey/action/getapiinput|getapiout|getdata
/apiinput/stats/json/organization/:orgId/:uniqueKey/action/getapiinput|getapiout|getdata
/apiinput/stats/json/organization/:orgId/user/:userName/:uniqueKey/action/getapiinput|getapiout|getdata



|---------------------------------------------------------------|
|  Delete a Dashboard
|---------------------------------------------------------------|

DELETE:  /apiinput/fileuploads/:uniqueKey
DELETE:  /apiinput/fileuploads/organization/:orgId/:uniqueKey

// ###############################################################//

Hope you find the post on summary of API capabilities in StatsPanda.com useful.

No comments:

Post a Comment