Solved

How do i send an api key in a request header

Posted on 2016-09-26
3
42 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for your help.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

0. Preface This Article is a replacement of http:/A_1788-Getting-your-EE-Ranking-statistics-in-Excel.html (http://http:/A_1788-Getting-your-EE-Ranking-statistics-in-Excel.html). Changes in the way Experts Exchange delivers point statistics, impleme…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

12 Experts available now in Live!

Get 1:1 Help Now