Hello experts,
I have received following error message when I am trying to use Rest API by powershell to create a new confluence page.
{"message":"Current user not permitted to use Confluence","statusCode":403}
But I can do it successfully before with the same codes, the last successful page created was on 02/18/2023. Following is the code:
#################################
$pair = "miansheng.wu@commscope.com:generatedToken"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$auth = "Basic " + $encodedCreds;
$Headers = {
Authorization = $auth; 'Content-Type' = 'application/json'
}
Invoke-WebRequest -Headers $Headers -Uri $uri -Method Post -Body '{"type":"page","title":"Test page","ancestors":[{"id":3734306868}], "space":{"key":"TEAM"},"body":{"storage":{"value":"Test body","representation":"storage"}}}'
#################################
Could you please help me? This issue blocks me a lot now.
Thanks,
Ken