SymetryML6.1
  • Introduction
  • Guides
    • Onboarding Guide
    • Technical Requirements
    • Admin User Guide
    • Installation Guide
      • Installation Guide - GPU
      • Installation Guide - Spark
  • SymetryML GUI
    • ML Toolkit
      • The SymetryML Difference
      • Data Mining Lifecycle
      • SymetryML Concepts
      • Data Sources
      • Streams
      • Encoders
      • Projects
      • Models
    • Sequence Models
    • SymetryML Federated Learning
      • Creating the Federation
      • Load data to local project
      • Requesting Federation Information from Admin Node
      • Joining a Federation with a peer node
      • Federated Data & Modelling
      • Appendix
    • DEM Generator
  • SymetryML Rest Client
    • REST API Reference Guide
      • SymetryML REST API Security
      • SymetryML JSON API Objects
      • Encoder Object REST API
      • SymetryML Projects REST API
      • About Federated Learning
      • Hipaa Compliance and Federated Learning
      • Federated Learning API
        • Federated Learning Topologies
        • Federated Learning with Nats
        • Federated Learning with AWS
        • Fusion Projects
      • Exploration API
      • Modeling API
      • Exporting and Importing Model
      • Third Party Model Rest API
      • SymetryML Job Information
      • Prediction API
      • Data Source API
      • Project Data Source Logs
      • Stream Data Source API
      • AutoML with SymetryML
      • Transform Dataframe
      • Select Model with SymetryML
      • Auto Select with SymetryML
      • Tasks API
      • Miscellaneous API
      • WebSocket API
      • Appendix A JSON Data Structure Schema
      • Appendix B Sample Code
  • SymetryML SaaS
    • SaaS Homepage
    • SaaS Dashboard
    • SaaS Account
    • SaaS Users
    • SaaS Licence
Powered by GitBook
On this page
  • WebSocket Overview
  • About WebSocket Authorization
  • Learning Using WebSocket
  • URL
  • Extra Parameter
  • WS Response
  • Sample WS Request
  • Forgetting Using WebSocket
  • URL
  • Extra Parameter
  • WS Response
  • Predicting Using WebSocket
  • URL
  • Extra Parameter
  • WS Response
  • Sample WS Request
  1. SymetryML Rest Client
  2. REST API Reference Guide

WebSocket API

WebSocket Overview

SymetryML supports the use of WebSocket technology on a subset of its API. This API can be used when lower latency is needed. Each WebSocket call contains a set of 3 pieces of information:

  • The header length

  • The headers, which are used to authenticate the request.

  • The message payload.

The message are string formatted using the following protocol

  • <Header-length>,<header><payload> ex:

  • 65,{headers=['some date','some md5','some authorization','some customer id'],extraKeys={}}{PAYLOAD}

The following table describes this information.

Header Length

Length of the header section.

Header

A JSON string containing 2 pieces of information - header[4] = an array of 4 string used for authorization.

- date

- md5

- authorization hash code.

- customer id

- extraKeys = contains extra information that depends on the WebSocket endpoint invoked. This Header field is mandatory on the first WebSocket message only.

WebSocket Payload

About WebSocket Authorization

With WebSocket, the following string must be used to create the Authorization hash code.

Item

Description

Authorization

Signature

Signature

Base64( HMAC-SHA2(UTF-8-Encoding-Of( StringToSign ) ) );

StringToSign

Content-MD5 + "\n" SymetryML-Secret-Key + "\n" Sym-Date Header + "\n" SymetryML-key-Id + "\n" RequestBody + "\n" ServicePath + "\n" extraKeys

Sym-Date format

ServicePath

Path of the URL to be invoked (for instance /symetry/ws/predict).

extraKeys

Each extra key should be included individually on a separate new line. See example below for details.

Example of WebSocket String to Sign

H47KwjgTU5G7v8BJS+ttgg== + '\n'
<SECRETKEY> + '\n'
2014-10-24 17:24:04 + '\n'
c1 + '\n'
{"attributeNames":["sepal_length","sepal_width","petal_length"],"data":[["4.3","3","1.1"]],"attributeTypes":["C","C","C"]} + '\n'
/symetry/ws/predict + '\n'
irisTest + '\n'
testLDA

Learning Using WebSocket

This API function call allows users to learn a dataframe using WebSocket services.

URL

ws://SERVER_HOST/symetry/ws/learn

Extra Parameter

Index

Short Description

Description

0

SymetryML Project ID

The name of the project to learn the data.

WS Response

HTTP Status Code

HTTP Status Message

Description

200

OK

Success.

Sample WS Request

Request URL:
ws://charm:8080/symetry/ws/learn
Request Message:
{"headers":["2014-10-24 14:28:03","PuAtwbvTrwlX8JQHWvtv7Q\u003d\u003d","Rz/EO7GXX/KE2Jj52+kePmIrudA\u003d","c1"],"extraKeys":["irisTest"]}-289907289{"attributeNames":["sepal_length","sepal_width","petal_length","petal_width","sepal_lengt_b1","sepal_lengt_b2","sepal_width_b1","sepal_width_b2","petal_length_b1","petal_length_b2","petal_width_b1","petal_width_b2","Iris_setosa","Iris_versicolor","Iris_virginica"],"data":[["4.3","3","1.1","0.1","1","0","0","1","1","0","1","0","1","0","0"],["4.8","3","1.4","0.1","1","0","0","1","1","0","1","0","1","0","0"],["4.9","3.1","1.5","0.1","1","0","0","1","1","0","1","0","1","0","0"],["4.9","3.
(...)
5","0","1","0","1","0","1","0","1","0","0","1"],["7.2","3.6","6.1","2.5","0","1","0","1","0","1","0","1","0","0","1"]],"attributeTypes":["C","C","C","C","B","B","B","B","B","B","B","B","B","B","B"]}

Forgetting Using WebSocket

URL

ws://SERVER_HOST/symetry/ws/forget

Extra Parameter

Index

Short Description

Description

0

SymetryML Project ID

The name of the project to learn the data.

WS Response

HTTP Status Code

HTTP Status Message

Description

200

OK

Success.

Predicting Using WebSocket

This API function call allows users to predict using WebSocket services.

URL

ws://SERVER_HOST/symetry/ws/predict

Extra Parameter

Index

Short Description

Description

0

SymetryML Project ID

The name of the project to learn the data.

1

Model Id

The model name to use to make predictions.

WS Response

Sample WS Request

Request URL
ws://charm:8080/symetry/ws/predict

Request Message:
{"headers":["2014-10-24 17:17:58","H47KwjgTU5G7v8BJS+ttgg\u003d\u003d","/Xd/JypB3rDQ+1BVaZRm6n35kt0\u003d","c1"],"extraKeys":["irisTest","testLDA"]}-289907289{"attributeNames":["sepal_length","sepal_width","petal_length"],"data":[["4.3","3","1.1"]],"attributeTypes":["C","C","C"]}

Response:
{"statusCode":"OK","statusString":"OK","values":{"KSVSMap":{"values":[{"res":"1","normZ":"0.2929126883636288","resZ":"-0.4559922893809558","z0":"-3.840891864408894","z1LTz0":"false"}]}}}
PreviousMiscellaneous APINextAppendix A JSON Data Structure Schema

Last updated 2 years ago

A JSON string representing a dataframe. See the for more details

See the section

This API function call allows users to forget a of data using WebSocket services.

On success this WebSocket call will return a JSONResponseClient containing a entity. The format of this response is the same as with the SymetryML REST prediction API described in .

Prediction API
Symetry Date Header
DataFrame
KSVSMap
DataFrame