I have a wrapper function that calls Survey Monkey methods on Excel VBA:
Function SM_Method(https As String, method As String, query As Variant) As String
Dim objSM As Object
Set objSM = CreateObject("MSXML2.XMLHTTP.6.0")
With objSM
.Open https, charSMAPI & method & "?api_key=" & charAPIKey
.setRequestHeader "Authorization", "Bearer " & charToken
.setRequestHeader "Content-Type", "application/json"
.Send query
SM_Method = .responseText
End With
End Function
I call this function as below which specifies the API query to print out certain fields:
Dim Request As Variant
Request = "{""fields"":[""per_page""]" & "}"
MsgBox (SM_Method("GET", "/surveys", Request))
But the above message box also prints out other fields such as "total", "data", "page", "links" etc...
I would love to get the query parameters working and was wondering what was wrong with my code above. Your help is greatly appreciated!