在VBA中获取Jira Rest API 403错误

问题描述

我已经使用其余的API为Jira编写了VBA脚本。

https://jira.domain.com/rest/api/2/issue/issue-id

我正在使用基本身份验证进行身份验证。脚本运行良好,直到两天前它开始给我403错误

该脚本对于其他人来说运行正常,只有我自己遇到了此问题。

看看我是否失去了访问权限,我也在浏览器中测试了该API,

我尝试使用浏览器(Talend API测试器),在该浏览器中工作正常。它只是在VBA中显示错误

Dim JiraService As New MSXML2.XMLHTTP60

Dim json As Object 'for parsing response to json
Dim IssueId As String 'for getting the issue-id from the user


IssueId = JiraIssue.IssueId.Value 'getting issue id from the user


'if issue id is not available exit the function
If IssueId = "" Then Exit Function

With JiraService
.Open "GET","https://jira.domain.com/rest/api/2/issue/" & IssueId,False
.setRequestHeader "Content-Type","application/json"
.setRequestHeader "Accept","application/json"
.setRequestHeader "Authorization","Basic " & UserPassBase64
.send ""

'if status 401 not authorized call method for login
If .Status = "401" Then
MsgBox "please Login" & vbNewLine & "invalid username/password"


If LoginForm.Visible = False Then
LoginForm.Show ' calling login pop-up Box to get userid and password
End If

'if issue does not exist
ElseIf .Status = "404" Then
MsgBox "issue does not exists",vbinformation,"Not Found" 'sending message if no issue is found
Exit Function

'if user don't have permission to see the issue
ElseIf .Status = "403" Then
MsgBox "You do not have permission to view the specified issue","Acess Denied"
Exit Function

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...