Excel VBA API token authentication

I like your way, much easier. Here’s the working code for VBA authentication:

Sub GetAsanaData()

Dim hReq As Object, Json As Dictionary
Dim sht As Worksheet
Dim authKey As String

authKey = {my Asana token key}

Set sht = Sheet1

Dim strUrl As String
    strUrl = "https://app.asana.com/api/1.0/users/me"
Set hReq = CreateObject("MSXML2.XMLHTTP")
    With hReq
        .Open "GET", strUrl, False
        .SetRequestHeader "Authorization", "Bearer " & authKey
        .Send
    End With

Dim response As String
    response = hReq.ResponseText
    
    MsgBox response

End Sub

2 Likes