RefreshToken=data['data']['refreshToken'] TypeError: 'NoneType' object is not subscriptable


  • On this code i am getting error. any one could help ?

    from smartapi import SmartConnect

    #create object of call
    obj=SmartConnect(api_key="")
    data = obj.generateSession('
    ','
    ___')

    refreshToken=data['data']['refreshToken']
    feedToken=obj.getfeedToken()

    #fetch User Profile
    userProfile= obj.getProfile(refreshToken)

    ERROR -
    RefreshToken=data['data']['refreshToken']
    TypeError: 'NoneType' object is not subscriptable