loginByPassword API is responding with `YOUR USER ID OR PASSWORD IS INVALID`


  • I'm getting the below response for https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword API

    {
      data: {
        status: false,
        message: "YOUR USER ID OR PASSWORD IS INVALID",
        errorcode: "AB1007",
        data: null
      }
    }
    

    Here is the code

    import util from 'util'
    import axios from 'axios'
    import address from 'address'
    import publicIp from 'public-ip'
    
    const getMACAddress = util.promisify(address.mac)
    
    const CLIENT_LOCAL_IP = address.ip() // 172.xx.x.xxx
    const CLIENT_PUBLIC_IP = await publicIp.v4() // 2.xx.xxx.xx
    const MAC_ADDRESS = await getMACAddress() // xx:xx:xx:xx:xx:xx
    
    axios({
        method: 'post',
        url:
          'https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword',
    
        headers: {
          'Content-Type': 'application/json',
          Accept: 'application/json',
          'X-UserType': 'USER',
          'X-SourceID': 'WEB',
          'X-ClientLocalIP': CLIENT_LOCAL_IP,
          'X-ClientPublicIP': CLIENT_PUBLIC_IP,
          'X-MACAddress': MAC_ADDRESS,
          'X-PrivateKey': API_KEY,
        },
        data: JSON.stringify({
          clientcode: CLIENT_ID,
          password: CLIENT_PASSWORD,
        }),
      })
        .then(function (response) {
          console.log(JSON.stringify(response.data))
          res.send({ data: response.data })
        })
        .catch(function (error) {
          console.log(error)
          res.send({ error })
        })
    

    I took CLIENT_ID (KRHI006) from https://trade.angelbroking.com/backoffice/AccSummary/

    I'm using same CLIENT_PASSWORD, which i used to login into https://trade.angelbroking.com/Login/

    I took API_KEY of Market Feeds APIs, which i created at https://smartapi.angelbroking.com/apps