API documentation URL conversion help needed

umamaheswaranp

New Member
Joined
Apr 28, 2016
Messages
2
Hi,

Below is the content from the API documentation
-----------------------------------------
Authentication and token exchange:
Once the request_token is obtained from the login flow, it should be POSTed to /session/token to complete the token exchange and retrieve the access_token.




curl https://api.kite.trade/session/token \
-H "X-Kite-Version: 3" \
-d "api_key=xxx" \
-d "request_token=yyy" \
-d "checksum=zzz"
----------------------------------

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
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,224,884
Messages
6,181,568
Members
453,053
Latest member
Kiranm13

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top