How to fill API Key parameter

Hi All,

I have a macro file which is using API link to import data.
Now I am trying to import the data from same link but not sure where and how to fill the key information.
can anybody help me out.

Below is the macro code which is running successfully.

Sub Button1_Click()

'Create the XmlHttp Object
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
'Set the URL of the API Endpoint
Url = "http://111.345.234.456/unknown_Api/api/DownloadReport/ABC"
objHTTP.Open "GET", Url, False
'Set the API Key
objHTTP.SetRequestHeader "X-XXX-Key", "1234567890"

'Send the API Request

'Define an object for holding the API Response
Dim response

'ensure that the call was successful
If objHTTP.readyState = 4 Then
    ' get the response text
    response = objHTTP.responseText
    'define a path where the ATT Report should be saved.
    Dim strTempPath As String
    strTempPath = ThisWorkbook.Worksheets(1).Range("B1").Text

    'save response to the above file
    Open strTempPath For Binary As #1
       Put #1, 1, DecodeBase64(response)
    Close #1
    MsgBox "Report downloaded to: " & strTempPath
    MsgBox "Error: " & objHTTP.Status
End If

End Sub

This line should be what you are looking for.

Hi Antriksh,

Yes, but not sure how to fill in parameter. can you share screen shot in which field I needs to fill this ?

I have a good experience with VBA but this part is a bit rusty, you should ask this question on Mr Excel Message board or VBA Express.

Hi Antriksh,

Thank you for the suggestion . but I am looking to import same data using Power Query. I just noticed I missed to mentioned