Quantsapp Embedded Modules
  • Quantsapp Embedded modules
  • Overview
  • 🔗Embed a Quantsapp Module
  • 💡Know more about Quantsapp
  • 🏁Getting Started with Iframe
    • 🗒️Attributes
      • Height
      • Width
      • sandbox
      • frameborder
      • src
    • ⚙️Setting restrictions
  • 🧑Authentication Modes
  • 🔑Partner Authentication
    • Open Partner
    • Verified Partner
  • ✨Products
    • Option Chain
    • Open Interest
    • Built-Up
    • Intraday-movers
    • FnO-News
    • Implied-Volatility(iv)-chart
    • GIFT-nifty
    • Ban-list
    • Architect
    • Option-calculator
    • Option-gain
    • Option-pain
    • India-vix
    • Liquidity-finder
    • Result-analysis
    • Rollover
    • Fno-Scanner
    • Synopsis
      • Future-OI
      • Options OI
      • F&O Volume
    • Deals and Holding
    • Index-Contribution
    • Advance Decline
    • Alerts
    • Technical Chart
    • Basis
    • Straddle Index
    • Market Wide Oi
    • PCR
      • OI PCR
    • Option Triggers
    • Strategies
    • Gainer Loser
    • Optimizer Find Strategies
    • Option Scalping
    • Out Runner
    • Participant Data
    • Price Oi Percentile
    • Trap Indicator
    • Unusual Option activity
    • Top-Stocks
    • Builtup-Breadth
    • Vol Trader
  • ✉️Contact Us
Powered by GitBook
On this page
  • STEP 1 : Get the partner Encryption Salt and name
  • STEP 2: Encrypt user info with the above salt
  • STEP 3: POST request for eToken
  • CODE EXAMPLE:
  • Few Example Urls:
  1. Partner Authentication

Verified Partner

PreviousOpen PartnerNextProducts

Last updated 1 year ago

A verified partner can directly pass an etoken in the query params to auto login the user inside quantsapp embedded module. Below are the steps to generate the etoken:

STEP 1 : Get the partner Encryption Salt and name

To get these details, email us at

STEP 2: Encrypt user info with the above salt

The user info has to be a json object with the following keys:

Key
Value

email

User's email Id. (eg. "email": "xyz@gmail.com")

epoch

Epoch time in string. (eg. "epoch": "1671627013")

country

Country code (eg. "country": "in")

app_type

This has to be set "o" for all cases.

mobile

User's mobile number prefixed with country code. (eg. "mobile": "91-3331112221")

name

User's name. (eg. "name": "Rahul Biswa")

NOTE: The above json object has to be stringified and right justified (256) encoded before encryption.

The above string has to be then encrypted using AES encption with mode ECB and the salt provided.

// SAMPLE REQUEST
{
    "profile": "kTput%2Bo39q%2F5L3vBVUEbUpE6brfqN%2Fav%2BS97wVVBG1KROm636jf2r%2Fkve8FVQRtSkTput%2Bo39q%2F5L3vBVUEbUpE6brfqN%2Fav%2BS97wVVBG1KROm636jf2r%2Fkve8FVQRtSkTput%2Bo39q%2F5L3vBVUEbUjsnfweifwfwif3weJFWSwweSXvLd1yp9mhGEOpBp6dXIp4V3vfblSV5nFxFsFptaUBA6h0f7X1XIEq6kZi2g6W2wFYtY32MkEuVMgCF27mGbyVVXKYUjyNX8XRHVJyqznsvvXWYPkORwNZk8nhcaX%2FpckYFez%2B%2B48F1xHKnSxeNjJLUbVwxa9Ju90%2BMOWHQ%3D%3D"
}

STEP 3: POST request for eToken

Body: The body will contain a JSON object with the following keys:

Key
Value

profile

This will contain the encrypted string from STEP2

POST https://partners.quantsapp.com/login/

Path Parameters

Name
Type
Description

partner_code*

String

This is the partner code given by quantsapp from STEP1

Request Body

Name
Type
Description

profile*

String

This will contain the encrypted string from STEP2

{
    "status": "1", 
    "msg": "success", 
    "etoken":           "lglyVGOlf8ohX8uWkgPMdR%2B9gNkSxYM6FZmWE7SixoUmEXKy2KMGFBmQMfy7RsaJQ3jNBcKOo4imgLvyb2btX03aZrD9Q75%2F4yDwtMXL0MMVwuAbf4GJnv7aUMNHTd5iwtLUe1jIN7IYYNzm7GICVmkpw8LbVY1DlGu0EBB%2F6bdnBbTCXyM%2FlYSiauiZ%2FX%2BwUtwuqcK6iNeQObTXjePTYLQ%3D%3D"
}
{
    // Response
}
// API success response example
{
    "Status": 200 
    "Data": {
    "status": "1", 
    "msg": "success", 
    "etoken":                "lglyVGOlf8ohX8uWkgPMdR%2B9gNkSxYM6FZmWE7SixoUmEXKy2KMGFBmQMfy7RsaJQ3jNBcKOo4imgLvyb2btX03aZrD9Q75%2F4yDwtMXL0MMVwuAbf4GJnv7aUMNHTd5iwtLUe1jIN7IYYNzm7GICVmkpw8LbVY1DlGu0EBB%2F6bdnBbTCXyM%2FlYSiauiZ%2FX%2BwUtwuqcK6iNeQObTXjePTYLQ%3D%3D"
    }
   }

ERROR CODES:

CODE EXAMPLE:

// SAMPLE python code
import requests
import json
from Crypto.Cipher import AES
from urllib.parse import quote
import base64
import time

# Partner api call
salt = b'{your salt key provided by quantsapp}'
event = dict()
epoch = str(int((dt.datetime.utcnow() - dt.datetime(1970,1,1)).total_seconds()))
payload = dict()
payload['epoch'] = epoch
payload['country'] = 'in'
payload['app_type'] = 'o'
payload['mobile'] = '91-1112221111' #format country_code-number for eg. 91-1234567890
payload['email'] = 'xyz@gmail.com'
payload['name'] = 'client name'
payload_b = json.dumps(payload).encode()
n_data = len(payload_b)
rj = math.ceil(n_data / 16) * 16
cipher = AES.new(salt, AES.MODE_ECB)
encrypted_payload = base64.b64encode(cipher.encrypt(payload_b.rjust(rj))).decode()
event['profile'] = encrypted_payload
url = 'https://partners.quantsapp.com/login/{#partner code provided by quantsapp}'
response = requests.post(url,json=event)
print(response.json())

Few Example Urls:

  • https://iframe.quantsapp.com/option-chain/NIFTY?eToken=liuyVGOlf8ohX8tWkgPMdR%2B9gNkSxYM6FZmWE7SixoUmEXKy2KMGFBmQMfy7RsaJQ3jNBcKOo7imUPvyy2btX07aZPD9Q75%2F4yDwtMXL0MMVxLf48EzMhPdF7z6lHzjOrtuUe1jIN0IYYKgm7GICVmjZvsVFOCKzIvqAj7hqSeW%2FBiTCXyM%2FliSiaoiZ%2FX%2BrUkcvr693CgbyNJ24EcQIRWw%3D%3D

  • https://iframe.quantsapp.com/option-gain?eToken=liuyVGOlf8ohX8tWkgPMdR%2B9gNkSxYM6FZmWE7SixoUmEXKy2KMGFBmQMfy7RsaJQ3jNBcKOo7imUPvyy2btX07aZPD9Q75%2F4yDwtMXL0MMVxLf48EzMhPdF7z6lHzjOrtuUe1jIN0IYYKgm7GICVmjZvsVFOCKzIvqAj7hqSeW%2FBiTCXyM%2FliSiaoiZ%2FX%2BrUkcvr693CgbyNJ24EcQIRWw%3D%3D

URL:

🔑
partner-support@quantsapp.com
https://partners.quantsapp.com/login/:partner_code