I am trying to use "https://api.bitbucket.org/2.0/repositories/" & BB_WORKSPACE & "/" & BB_REPO & "/pullrequests"
Dim baseUrl As String
baseUrl = "https://api.bitbucket.org/2.0/repositories/" & BB_WORKSPACE & "/" & BB_REPO & "/pullrequests"
' Build query:
' q=destination.branch.name="main" AND state="MERGED"
Dim q As String
q = "destination.branch.name=""" & DEST_BRANCH & """ AND state=""MERGED"""
Dim fields As String
fields = "values.id,values.title,values.created_on,values.closed_on," & _
"values.source.branch.name,values.destination.branch.name,next"
Dim url As String
url = baseUrl & "?q=" & UrlEncode(q) & "&fields=" & UrlEncode(fields) & "&pagelen=50"
Dim cycles() As Double
Dim cycleCount As Long
cycleCount = 0
Do While Len(url) > 0
Dim json As String
json = HttpGet_BB(url, BB_USER, BB_TOKEN)
Loop
I am receiving error 401.
I tried
Private Const BB_USER As String = "your-email"
Private Const BB_TOKEN As String = "your-app-password"
or
Private Const BB_USER As String = "x-token-auth"
Private Const BB_TOKEN As String = "your-workspace-token"
Private Const BB_WORKSPACE As String = "your-workspace"
Private Const BB_REPO As String = "your-repo"
Private Const DEST_BRANCH As String = "main"
I need help in how to generate the token from Bitbucket.
I tried to use it from Workspace as well as repo.
I receiving 401 in both the cases.