-
Notifications
You must be signed in to change notification settings - Fork 3
/
WunderlistGetAllLists
44 lines (33 loc) · 1.44 KB
/
WunderlistGetAllLists
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Function fWunderlistGetLists()
'============================================================================
' Name : fWunderlistGetLists
' Author : Erica L Ingram
' Copyright : 2019, A Quo Co.
' Call command: Call fWunderlistGetLists()
' Description : gets list of all lists on Wunderlist
'============================================================================
Dim sURL As String, sUserName As String, sResponseText As String
Dim sToken As String, sJSON As String
'global variables used here are: sWLListID
Call fWLGenerateJSONInfo 'refreshes necessary JSON info
'get sUsername/sToken, not provided here
sURL = "https://a.wunderlist.com/api/v1/user"
sJSON = "{" & Chr(34) & "list_id" & Chr(34) & ": " & sWLListID & "}" 'sWLListID is list I.D. number
Debug.Print "sJSON--------------------------------------------"
Debug.Print sJSON
Debug.Print "RESPONSETEXT--------------------------------------------"
sURL = "https://a.wunderlist.com/api/v1/lists"
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "GET", sURL, False
.setRequestHeader "X-Access-Token", sToken
.setRequestHeader "X-Client-ID", sUserName
.setRequestHeader "Content-Type", "application/json"
.send sJSON
sResponseText = .responseText
sToken = ""
sUserName = ""
.abort
Debug.Print sResponseText
Debug.Print "--------------------------------------------"
End With
End Function