POST request to Confluence returns 403 Error

MichaelMoe May 7, 2015

I'm trying to create a page from powershell using the following command -

$json = "{""type"": ""page"",""title"": ""My test page 2"",""space"": {""key"": ""TST""},""body"": {""storage"": {""value"": ""Another testing"",""representation"": ""storage""}}}"

$res = Invoke-RestMethod https://xxxx.xxx.net/wiki/rest/api/content/ -Method Post -Body $json -Headers @{Authorization = "Basic xxxxxxx"} -ContentType 'application/json'

However, I'm getting 403 Error. I can create page using menu options with no problem, so clearly I have necessary authority. I can also make GET request with no problem. I appreciate if anyone could point out my mistake.

 

Thanks 

3 answers

1 accepted

2 votes
Answer accepted
Rodrigo Girardi Adami
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 11, 2015

Hi Michael Moe,

Since you have fixed this case I'll mark this question as answered.

Cheers,

Rodrigo

0 votes
MichaelMoe May 8, 2015

Nope, my stupid mistake. I fixed that and now it works. Thanks!!

0 votes
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2015

Do you have a space with the key "TST"?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events