Solved

How do i send an api key in a request header

Posted on 2016-09-26
3
83 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 50

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Being an active EE Expert means to get a lot of (E)EMail, as you certainly know. If you are using Outlook, I'll show you how to minimize your inbox contents without losing anything – even improve the experience by changing the Subject line to facili…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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