Login error

umamaheswaran
I tried below VBA code and it is giving me "Missing or bad request parameters or values" error. Is my URL conversion from API document is valid?

Sub doLogin()
Dim api As String, requestToken As String, checksum As String, fullData As String, URL As String, jsonData As String

Dim JSON As Object
api = ThisWorkbook.Sheets("Login").Range("B1").Value
requestToken = ThisWorkbook.Sheets("Login").Range("B2").Value
checksum = ThisWorkbook.Sheets("Login").Range("B4").Value
URL = "https://api.kite.trade/session/token"
fullData = "X-Kite-Version: 3" & "api_key=" & api & "request_token=" & requestToken & "checksum=" & checksum

'
jsonData = CallPostMethod(URL, fullData)
MsgBox jsonData
Set JSON = JsonConverter.ParseJson(jsonData)
End Sub
Sign In or Register to comment.