It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Not able to create Space using Rest API

Hi,

I am having the permission to create space in Confluence but I am not able to do the same using Rest API in Jmeter.

Received Error is 403 - Forbidden Error.

It would be helpful if you provide header manager content.

Regards,

Kulasekhar

 

1 answer

0 votes
Minh_Tran Atlassian Team Jan 09, 2020

@PASUPULA REDDY It is very hard to provide the help with less information.

Can you please let me know if you can call REST api successfully outside JMeter? What is the exact command have you run? And what is the one you passed to JMeter? Can you share?

thanks for the response.

I am passing the credentials inside J-meter

PFB Code which i am trying to create the space using Rest Api in j-meter and the method calling is "post". 

{

"key": "TST_CONF",
"name": "APT_Confluence",
"description": {
"plain": {
"value": "This is an example space",
"representation": "plain"
}
},
"metadata": {}
}

And also, posting the error code below.

{"statusCode":403,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"Cannot create Space","reason":"Forbidden"}.

And also adding additional info here

https://localhost:8095/rest/api/space - this rest api path I am calling inside J-meter

Minh_Tran Atlassian Team Jan 10, 2020

@PASUPULA REDDY Can you try to make it work without Jmeter first? I suspect your account does not have enough permission to create space

That is why the status code returns 403

I have created the space successfully by physically, i don't think its space permission issue. can you please guide us how to resolve above mentioned issue.

Minh_Tran Atlassian Team Jan 12, 2020

@PASUPULA REDDY What exact Confluence Server version are you using?

Can you please give me a sample curl command that could not create the space for you?

Confluence 7.2.0 - this is the confluence version currently we are using and we are not using any kind of curl command.

We are using below code to create space using rest api.

{

"key": "TST_CONF",
"name": "APT_Confluence",
"description": {
"plain": {
"value": "This is an example space",
"representation": "plain"
}
},
"metadata": {}
}

 

Method I used is "POST"

Minh_Tran Atlassian Team Jan 13, 2020

Ok, if you don't use curl. Can you give me the complete source code that you use to create space?

I need something to troubleshoot why you can't create space

We are using below code to create space using rest api.

{

"key": "TST_CONF",
"name": "APT_Confluence",
"description": {
"plain": {
"value": "This is an example space",
"representation": "plain"
}
},
"metadata": {}
}

 

Method I used is "POST"

Minh_Tran Atlassian Team Jan 14, 2020

@PASUPULA REDDY That does not help me in understanding how you create the REST call :)

I want to know exact code snippet that you used to create the REST call to Confluence what problem you have really experienced so i can provide the instruction or troubleshooting

Hi,

When you work with Confluence from browser you can see on top right menu items to export current page as Word or PDF. What is an equivalent to make similar export from REST API? Thank you very much in advance

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

302 views 9 7
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you