Zoho Inventory API gets 401 error

Zoho Inventory API gets 401 error

Hi,

I have been trying to connect through the inventory API using the self-client authentication generated codes and I keep getting error 401 Unauthorized access. I am trying to connect from Excel VBA with the codes below(replaced all credentials with XXXX):

Dim url As String, parameters As String

    With CreateObject("MSXML2.XMLHTTP.6.0")
        parameters = "method=worksheet.list"
        url = "https://inventory.zoho.in/api/v1/items?organization_id=XXXX"
        .Open "GET", url, False
        .SetRequestHeader "Authorization", "Zoho-oauthtoken XXXX"
        .SetRequestHeader "Content-type", "application/x-www-form-urlencoded;charset=UTF-8"
        .Send
        Debug.Print .Status
    End With