Solved

How do i send an api key in a request header

Posted on 2016-09-26
3
55 Views
Last Modified: 2016-10-01
I'm using a service that provides an api to get data out of our online, hosted database. I've never called data this way from VBA and am wondering how to do it.
I have an api key, username, password but am not sure how to put code together to make it work.
Code I've put together is below:

Dim httpreq As New MSXML2.XMLHTTP60, myurl As String
myurl = "https://cowtown.breezechms.com/api/people"
httpreq.Open "GET", myurl, False
httpreq.setRequestHeader "Content-Type", "application/json"
httpreq.setRequestHeader "dduck", "abc123"
httpreq.send
MsgBox (httpreq.responseText)

The MsgBox just kicks back the following response.

"Permission Denied - API key () does not match subdomain (cowtown)"
0
Comment
Question by:emeschke
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41817134
based on the documentation it only provide you sample in PHP.

List People
https://cowtown.breezechms.com/api/#people

are you able to contact to their site support to ask for further assistance? without proper documentation we will not know what to be passed to the web service.
0
 

Assisted Solution

by:emeschke
emeschke earned 0 total points
ID: 41824765
I got a hold of their support and found that the username was Api-key and then to use your api key as the password. Things work well now!
0
 

Author Closing Comment

by:emeschke
ID: 41824766
Thanks for your help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now