Basic Authentication not working - Jira API

Marcus_Dyer June 26, 2020

I followed this guide: 

https://developer.atlassian.com/server/jira/platform/basic-authentication/

I entered the line into command prompt:

"curl -H "Authorization: Basic MYBASE64STRING" -X GET -H "Content-Type: application/json" http://MYSERVERSITE/jira/rest/api/latest/issue/BIT-1234?MYJQLSEARCH"

Then in the command prompt it gives me the JSON data. My question is what do I do from here? Because when I use excel VBA to grab the JSON data it says "You do not have permission to see the specified issue. Login-required." 

Anyone know what's wrong? 

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2020

Hi Marcus,

It sounds like curl is working as expected (you get JSON back with information about the issue) and the issue is with using the same API call with VBA in Excel. Is that right?

In looking through another Community thread, it seems that a common problem is not including the right headers. Without seeing your VBA code, I might suggest checking all the headers you have set against those listed in various answers on that thread.

I'm no VBA expert, but I was able to find a tutorial with code examples that might also be helpful:

This should provide some boilerplate code to start with for you to swap in your credentials and Jira Server URL.

Cheers,
Daniel

Marcus_Dyer June 28, 2020

Hi Daniel, 

Thanks for the reply. Yes that is the issue. I made a button and made a module and the code is excel code right now is:

Sub Hello() 
Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
MyRequest.Open "Get", "MYLINK"
MyRequest.Send
MsgBox MyRequest.ResponseText
End Sub

 The link to the other community thread you provided is actually exactly what I want to do, but right now I'm just trying to get the JSON data to appear in a message box to make sure the API call is actually working. Can you please let me know the error in my code? Thanks. 

Suggest an answer

Log in or Sign up to answer