I was able to get the REST API command to work using cURL within PowerShell, but we want to save the results in an MS Access Database, which means if we can execute the REST API command within MS Access VBA it'll be easier to save into the Database. The online documentation shows how to execute the REST API commands in several languages, but not in VBA. Please don't just point me to googled VBA pages. I've spent many hours googling and reading and been unable to get any examples to work. If you can, please provide the VBA code that will work.
The REST API commands were taken from: https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-group/#api-wiki-rest-api-group-groupname-get
Below are the REST API commands I am able to execute within PowerShell using cURL:
cURL.exe --request GET --Url 'https://xxxxxxxx.atlassian.net/wiki/rest/api/group/member?name=confluence-users&shouldReturnTotalSize=true' --user 'myemailaddress:mytoken' --header 'Accept: application/json'
cURL.exe --request GET --Url 'https://xxxxxxx.atlassian.net/wiki/rest/api/group/member?next=true&name=confluence-users&limit=200&start=200&shouldReturnTotalSize=true' --user 'myemailaddress:mytoken' --header 'Accept: application/json'
cURL.exe --request DELETE --url 'https://xxxxxxx.atlassian.net/wiki/rest/api/group/user?accountId=theusersaccountid&name=confluence-users' --user 'myemailaddress:mytoken' --header 'Accept: application/json'
I have tried the following VBA code, but the status it returns is: 403, Forbidden, "Current user not permitted to use Confluence"
Dim objHTTP As Object
Dim sUrl As String
Dim sResponseText As String
Dim sStatus As String
Dim sStatusText As String
sUrl = "https://xxxxxxx.atlassian.net/wiki/rest/api/group/member?name=confluence-users&shouldReturnTotalSize=true"
'Set objHTTP = CreateObject("MSXML2.XMLHTTP")
'Set objHTTP = New MSXML2.XMLHTTP60
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
With objHTTP
.Open "GET", sUrl, False
.SetCredentials "myemailaddress", "mytoken", 0
.setRequestHeader "Accept", "application/json"
.send
End With
sResponseText = objHTTP.responseText
sStatus = objHTTP.status
sStatusText = objHTTP.statusText