# Excel VBA API token authentication

**URL:** <https://forum.asana.com/t/excel-vba-api-token-authentication/49943>\
**Category:** API & Developers\
**Created:** [15 May 2019 18:37 UTC](https://forum.asana.com/t/excel-vba-api-token-authentication/49943 "2019-05-15T18:37:33Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Kevin\_Player](https://luna1.co/8d76cd.png) [@Kevin\_Player](https://forum.asana.com/u/Kevin_Player)\
**Post date:** [15 May 2019 21:40 UTC](https://forum.asana.com/t/excel-vba-api-token-authentication/49943/9 "2019-05-15T21:40:37Z")

</div>

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

---

_[View the full topic](https://forum.asana.com/t/excel-vba-api-token-authentication/49943)._
