Hi community!
I'm facing an issue when I'm trying to create a page on confluence cloud using API v2.
When I use this
GET 'https://companyname.atlassian.net/wiki/api/v2/pages' I have results correctly but when I use the API to create a new page I have 404 POST
https://companyname.atlassian.net/wiki/api/v2/pages
with this body
Hi @Cristiano Sticca
As mentioned here:
https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post
404 Not Found
Returned if:
Check the space permissions.
Ive tested this:
https:/my.atlassian.net/wiki/api/v2/pages with a POST and this body and it works.
{ "spaceId": "33009", "status": "current", "title": "Interesting page title", "parentId": "33096", "body": { "representation": "storage", "value": "<p>The page content</p>" }}
Regards
Aaron
Thanks @Aaron Pavez _ServiceRocket_ for your quick reply. Can you help my on checking my permission? Because with my user I can create pages on the space so I don’t know where the problem about permissions is. thanks again
Can you test the body I used? On yours, you are missing this:
Hi @Aaron Pavez _ServiceRocket_ yes I used also the same body you used but same error. I’m using my API token the same I use for the other API (get pages) that works.
Maybe I’m wrong with the space and parent id? Is there a friendly way to get them, I mean get them directly from Confluence pages?
Hi!
How? I'm using the curl with Postman but don't know how to use it in the Atlassian page
With postman you dont need to user curl.
add the URL
in authorization
- Username: use your email
- Password: your token
the body is the one I've shared earlier. select raw and JSON at the end.
That should do it.
regards
Here you have:
1) the API that works (Get Pages)
2) the API that doesn't work (Create Page)
Same url, same user, same API token ...
Hi , I am also experiencing the same issue this is my schema. I am facing the 404 issues in the backend when I try to find the space using the id. In the postman I am using the basic auth but in the schema below ouath-bearer auth. The api are
https://name.atlassian.net/wiki/api/v2/spaces?keys=name (get)
https://name.atlassian.net/wiki/api/v2/pages (post).
Have i made a mistake here?
openapi: 3.1.0info:title: Atlassian Confluence APIversion: 1.0.0servers:- url: https://sample.atlassian.net/wiki/api/v2- description: Confluence Serverpaths:/spaces:get:operationId: getSpaceInformationsummary: Retrieve space informationparameters:- in: queryname: keysrequired: trueschema:type: stringdescription: The key of the space to retrieveresponses:'200':description: Successcontent:application/json:schema:type: objectproperties:id:type: stringsecurity:- bearerAuth: []
/pages:post:operationId: createPagesummary: Create a new pagerequestBody:required: truecontent:application/json:schema:type: objectproperties:spaceId:type: stringstatus:type: stringtitle:type: stringparentId:type: stringbody:type: objectproperties:representation:type: stringexample: storagevalue:type: stringrequired:- spaceId- status- title- bodyresponses:'200':description: Page created successfullysecurity:- bearerAuth: []
components:securitySchemes:bearerAuth:type: httpscheme: bearerbearerFormat: JWT
It looks like you're new here. Sign in or register to get started.