When i Connect to Confluemce using the REST API i get an 403 error.
The ConfluenceURL and the PostURL are correct and show results in the webbrowser.
Within our company we use 2FA. Therefore I generated an API Token in Confluence and used it in this script.
Buit still i got an 403 error.
What could be wrong?
This is a part of the script i use:
Dim strApiToken: strApiToken = "<My Token>"
Dim strConfluenceURL: strConfluenceURL = "https://<MyCompany>.atlassian.net"
Dim strSpaceKey: strSpaceKey = "<MySpaceKey"
Dim strPageTitle: strPageTitle = "<MyPageTitle>"
Dim strPostURL: strPostURL = strConfluenceURL & "/rest/api/content"
Dim objHTTP: Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
Dim strJSON
strJSON = "{""type"": ""page"",""title"": """ & strPageTitle & """, ""space"": {""key"": """ & _
strSpaceKey & """}, ""body"": {""storage"": {""value"": """ & _
Replace(strContent, """", "\""") & """, ""repressentation"": ""storage""}}}"
objHTTP.open "POST", strPostURL, False
objHTTP.setRequestHeader "Content-Type", "application/json"
objHTTP.setRequestHeader "Authorization", "Bearer " & strApiToken
objHTTP.send strJSON