'USGA - GHIN API - Invalid Token
There are a couple of similar questions here, but the answers don't seem to go quite far enough to solve my issue. I'm using the code provided by "asmitu" (thank you!) but it's getting a response of "Error:Invalid Token".
Const Url = "https://api2.ghin.com/api/v1/public/login.json?"
Const Link = "https://api2.ghin.com/api/v1/followed_golfers/"
Dim Http As New XMLHTTP60, ghinNum$, lastName$
ghinNum = "valid-ghin-number"
lastName = "valid-password"
With Http
.Open "GET", Url & "ghinNumber=" & ghinNum & "&lastName=" & lastName & "&remember_me=false", False
.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
.setRequestHeader "Referer", "https://www.ghin.com/login"
.send
.Open "GET", Link & ghinNum & ".json", False
.send
End With
MsgBox Http.responseText
This site has some info on the API - https://app.swaggerhub.com/apis-docs/GHIN/Admin/1.0#/User%20APIs/post_users_login__format_ But I can't figure how to capture a valid token from the first API call above to use to pass to the API for the second call to the API under the same GHIN number and password. If someone has gotten this to work, can you help a brother out, please? Thank you.
Solution 1:[1]
I reached out to the USGA GHIN folk and, surprisingly and thankfully, got an answer. Not the answer I wanted but there you go. Basically, they said: "they have a requirement that your software supports 10 clubs or 1,400 golfers." So that lets me out.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dozey |
