-
Notifications
You must be signed in to change notification settings - Fork 3
/
WunderListGetList
43 lines (37 loc) · 1.66 KB
/
WunderListGetList
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 fWunderlistGetTasksOnList1()
'============================================================================
' Name : fWunderlistGetTasksOnList1
' Author : Erica L Ingram
' Copyright : 2019, A Quo Co.
' Call command: Call fWunderlistGetTasksOnList()
' Description : gets tasks on a wunderlist list
'============================================================================
Dim sToken As String, sJSON As String
Dim sURL As String, sUserName As String, sResponseText As String
'this function uses global variable strs sWLListID
Call fWLGenerateJSONInfo 'generates json variable info
'get token & username, not provided here
sJSON = "{" & Chr(34) & "list_id" & Chr(34) & ": " & sWLListID & "}" 'sWLListID is the I.D. number of the list
'a lot of debug prints in case you want to see what's going on
Debug.Print "sJSON--------------------------------------------"
Debug.Print sJSON
Debug.Print "RESPONSETEXT--------------------------------------------"
sURL = "https://a.wunderlist.com/api/v1/tasks?list_id=" & sWLListID
With CreateObject("WinHttp.WinHttpRequest.5.1")
'.Visible = True
.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 = ""
Debug.Print sResponseText
Debug.Print "--------------------------------------------"
Debug.Print .Status
Debug.Print .StatusText
Debug.Print "--------------------------------------------"
.abort
End With
End Function