Solved

How do i send an api key in a request header

Posted on 2016-09-26
3
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

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

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

691 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