User Login Flow

Steps to follow for login

  1. Go to login URL.
  2. Replace the xxx in address bar with the api_key value provided by Nuvama.
  3. https://www.nuvamawealth.com/api-connect/login?api_key=xxx
    

    image info

  4. Enter Login id and Password.
  5. Enter OTP.
  6. image info

  7. You will get redirected to the link (default - https://127.0.0.1/) and it will have request_id in the address bar.
  8. image info

  9. Use this request_id when calling the constructor of APIConnect class.
  10. APIConnect("apiKey", "apiSecret", "requestId", downloadContract, "File_path_to_external_INI_file")
    

    This is APIConnect class. Please initialise single instance of this per apiKey using the login parameters. downloadContract: Set this to to True to download all the contracts and return the records in dictionary instruments. It is recommended to keep this as True when running the code for the first time, and to refresh the downloaded contract files periodically.

Get Login Info

This method enables the user to get all full user profile information in one place.

GetLoginData()
{
  "appID": "56565656XXXXX",
  "config": {},
  "data": {
    "type": "loginAuthDataResponse",
    "auth": "YYYYYYYYYYYYYYYYYYYYY",
    "lgnData": {
      "accTyp": "EQ",
      "mrgSts": "ONE_ACCOUNT",
      "excs": [
        "NSE",
        "CDS",
        "BSE",
        "NFO"
      ],
      "dfPrds": {
        "BFO": {
          "by": "FNO Plus (NRML)",
          "sl": "FNO Plus (NRML)"
        },
        "BSE": {
          "by": "Delivery (CNC)",
          "sl": "Delivery (CNC)"
        },
        "CDS": {
          "by": "FNO Plus (NRML)",
          "sl": "FNO Plus (NRML)"
        },
        "NFO": {
          "by": "FNO Plus (NRML)",
          "sl": "FNO Plus (NRML)"
        },
        "NSE": {
          "by": "Delivery (CNC)",
          "sl": "Delivery (CNC)"
        }
      },
      "dfPrdsMTF": {
        "NSE": {
          "by": "Delivery (CNC)",
          "sl": "Delivery (CNC)"
        }
      },
      "ordTypes": [
        {
          "key": "LIMIT",
          "value": "LIMIT"
        },
        {
          "key": "MARKET",
          "value": "MARKET"
        },
        {
          "key": "SL",
          "value": "STOP_LIMIT"
        },
        {
          "key": "SL-M",
          "value": "STOP_MARKET"
        }
      ],
      "sts": "OK",
      "accs": {
        "bseMfstwt": true,
        "cdslEsFlg": false,
        "eml": "XXXXXX",
        "eqAccID": "BBBBB",
        "eqAccName": "BBBBB",
        "eqAlgoClnt": "N",
        "eqBrId": "BOMBAY",
        "eqBrk": "EBL_CAS",
        "eqBrkCode": "EBL_CAS",
        "eqDob": "1994-10-10",
        "eqEmpCat": "NA",
        "eqRmRt": "NA",
        "eqstwt": true,
        "llt": "09/04/2021 11:48:54",
        "mfInf": false,
        "prfId": "HHHHHH",
        "rstpwd": true,
        "rstusr": false,
        "ucmCd": "",
        "uid": "BBBBB",
        "wtspCnsnt": "t"
      },
      "mtf": {
        "popFl": "false",
        "sts": "C"
      },
      "adhrEQ": {
        "popFl": "true",
        "rlEDt": "2030-03-31",
        "rlFl": "true",
        "sts": "NOTVALIDATED"
      },
      "cnsntLst": [
        {
          "accType": "EQ",
          "mdtry": true,
          "name": "SSSSS"
        }
      ],
      "prds": [
        {
          "exc": "NSE",
          "prd": [
            {
              "prdDpNm": "Bracket Order (BO)",
              "prdVal": "BO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "Delivery (CNC)",
              "prdVal": "CNC",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                },
                {
                  "dpNm": "Good Till Cancellation(GTC)",
                  "vaVal": "GTC"
                },
                {
                  "dpNm": "Good Till Date(GTD)",
                  "vaVal": "GTD"
                }
              ]
            },
            {
              "prdDpNm": "Cover Order",
              "prdVal": "CO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                }
              ]
            },
            {
              "prdDpNm": "Intraday (MIS)",
              "prdVal": "MIS",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "Margin Trading (MTF)",
              "prdVal": "MTF",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "Delivery Plus (NRML)",
              "prdVal": "NRML",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            }
          ]
        },
        {
          "exc": "BSE",
          "prd": [
            {
              "prdDpNm": "Bracket Order (BO)",
              "prdVal": "BO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                },
                {
                  "dpNm": "EOS",
                  "vaVal": "EOS"
                }
              ]
            },
            {
              "prdDpNm": "Delivery (CNC)",
              "prdVal": "CNC",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                },
                {
                  "dpNm": "EOS",
                  "vaVal": "EOS"
                },
                {
                  "dpNm": "Good Till Cancellation(GTC)",
                  "vaVal": "GTC"
                },
                {
                  "dpNm": "Good Till Date(GTD)",
                  "vaVal": "GTD"
                }
              ]
            },
            {
              "prdDpNm": "Cover Order",
              "prdVal": "CO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "EOS",
                  "vaVal": "EOS"
                }
              ]
            },
            {
              "prdDpNm": "Intraday (MIS)",
              "prdVal": "MIS",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                },
                {
                  "dpNm": "EOS",
                  "vaVal": "EOS"
                }
              ]
            },
            {
              "prdDpNm": "Margin Trading (MTF)",
              "prdVal": "MTF",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                },
                {
                  "dpNm": "EOS",
                  "vaVal": "EOS"
                }
              ]
            },
            {
              "prdDpNm": "Delivery Plus (NRML)",
              "prdVal": "NRML",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                },
                {
                  "dpNm": "EOS",
                  "vaVal": "EOS"
                }
              ]
            }
          ]
        },
        {
          "exc": "NFO",
          "prd": [
            {
              "prdDpNm": "Bracket Order (BO)",
              "prdVal": "BO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "Cover Order",
              "prdVal": "CO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                }
              ]
            },
            {
              "prdDpNm": "Intraday (MIS)",
              "prdVal": "MIS",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "FNO Plus (NRML)",
              "prdVal": "NRML",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            }
          ]
        },
        {
          "exc": "BFO",
          "prd": [
            {
              "prdDpNm": "Bracket Order (BO)",
              "prdVal": "BO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "Cover Order",
              "prdVal": "CO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                }
              ]
            },
            {
              "prdDpNm": "Intraday (MIS)",
              "prdVal": "MIS",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "FNO Plus (NRML)",
              "prdVal": "NRML",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            }
          ]
        },
        {
          "exc": "CDS",
          "prd": [
            {
              "prdDpNm": "Bracket Order (BO)",
              "prdVal": "BO",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "Intraday (MIS)",
              "prdVal": "MIS",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            },
            {
              "prdDpNm": "FNO Plus (NRML)",
              "prdVal": "NRML",
              "validity": [
                {
                  "dpNm": "DAY",
                  "vaVal": "DAY"
                },
                {
                  "dpNm": "Immediate or Cancel(IOC)",
                  "vaVal": "IOC"
                }
              ]
            }
          ]
        },
        {
          "exc": "ESIP",
          "prd": [
            {
              "prdDpNm": "Delivery Plus (NRML)",
              "prdVal": "NRML",
              "validity": []
            }
          ]
        }
      ],
      "val": [
        {
          "exc": "NSE",
          "validity": [
            {
              "dpNm": "DAY",
              "vaVal": "DAY"
            },
            {
              "dpNm": "Immediate or Cancel(IOC)",
              "vaVal": "IOC"
            },
            {
              "dpNm": "Good Till Cancellation(GTC)",
              "vaVal": "GTC"
            },
            {
              "dpNm": "Good Till Date(GTD)",
              "vaVal": "GTD"
            }
          ]
        },
        {
          "exc": "BSE",
          "validity": [
            {
              "dpNm": "DAY",
              "vaVal": "DAY"
            },
            {
              "dpNm": "Immediate or Cancel(IOC)",
              "vaVal": "IOC"
            },
            {
              "dpNm": "EOS",
              "vaVal": "EOS"
            },
            {
              "dpNm": "Good Till Cancellation(GTC)",
              "vaVal": "GTC"
            },
            {
              "dpNm": "Good Till Date(GTD)",
              "vaVal": "GTD"
            }
          ]
        },
        {
          "exc": "NFO",
          "validity": [
            {
              "dpNm": "DAY",
              "vaVal": "DAY"
            },
            {
              "dpNm": "Immediate or Cancel(IOC)",
              "vaVal": "IOC"
            }
          ]
        },
        {
          "exc": "BFO",
          "validity": [
            {
              "dpNm": "DAY",
              "vaVal": "DAY"
            },
            {
              "dpNm": "Immediate or Cancel(IOC)",
              "vaVal": "IOC"
            }
          ]
        },
        {
          "exc": "CDS",
          "validity": [
            {
              "dpNm": "DAY",
              "vaVal": "DAY"
            },
            {
              "dpNm": "Immediate or Cancel(IOC)",
              "vaVal": "IOC"
            }
          ]
        }
      ],
      "gtdGtcValDays": "90",
      "srcVendor": "TESTXX",
      "vndSrc": "API",
      "reqId": "8888xxxx",
      "url": "https://127.0.0.1"
    }
  },
  "msgID": "YYYYzzzzz",
  "srvTm": 123456
}

Logout

Logout()

This call invalidates the Request id and destroys the API session. After this, the user should be sent through a new login flow before further interactions with the APIs.