Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to create Space using Rest API

PASUPULA REDDY January 9, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 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?

PASUPULA REDDY January 9, 2020

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"}.

PASUPULA REDDY January 9, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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

PASUPULA REDDY January 12, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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?

PASUPULA REDDY January 13, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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

PASUPULA REDDY January 13, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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

PASUPULA REDDY January 22, 2020

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
AUG Leaders

Atlassian Community Events