API Usage on Excel VBA

Hi everyone,

I’m not very good with HTTP knowledge and I am unsure of how to use the APIs on vba. I am trying to retrieve submitted data for a specific form(curl -X GET https://kc.kobotoolbox.org/api/v1/data/22845) and populate the retrieved data into rows on excel.

Any help would be greatly appreciated

This is currently what I have now but I seem to be unable to authenticate my credentials properly leading to a detail not found response

This is what I have now but the response i get now is detail not found. I seem to be unable to authenticate my credentials.

Sub thisthat()

Dim myReq As WinHttpRequest

Set myReq = New WinHttpRequest

myReq.Open “POST”, “http://kc.kobotoolbox.org/api/v1/data/8029.csv”, False

'Set credentials

myReq.SetRequestHeader “Authorization”, "Basic " + Base64Encode(“username” + “:” + “password”)

myReq.Send

MsgBox (myReq.ResponseText)

End Sub

···

On Friday, March 20, 2015 at 12:30:03 PM UTC+8, Terence Lim wrote:

Hi everyone,

I’m not very good with HTTP knowledge and I am unsure of how to use the APIs on vba. I am trying to retrieve submitted data for a specific form(curl -X GET https://kc.kobotoolbox.org/api/v1/data/22845) and populate the retrieved data into rows on excel.

Any help would be greatly appreciated

Is there any news about this post?

Also would it be possible to codificate to upload a csv file in the media section of a survey?

Imagine this: a code that download previous observation, treat them and upload the document as a pre-loaded csv and then that open the survey in the browser.
You could have a question type based on previous observations :smiley: