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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,213,506
Messages
6,114,027
Members
448,543
Latest member
MartinLarkin

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