Rest API from Postman is not working in Confluence
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Confluence Data Center is unable to receive when calling REST API in the Postman client.
Environment
Confluence Data Center 7.13.7
Diagnosis
Check if you have enabled rate limit in Confluence.
Check if you can call REST API using the curl command
1 2 3
curl -u <username>:<password> -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"new page", "space":{"key":"<space_key>"},"body":{"storage":{"value":"<p>This is <br/> a new page</p>","representation": "storage"}}}' https://BASEURL/rest/api/content/ | python -mjson.tool
Check Confluence access log if you see the PostmanRuntime/7.29.0 request like this (if not move to the solution):
1
[29/Jun/2022:10:43:10 +0200] xxxx http-nio-27164-exec-5 0:0:0:0:0:0:0:1 POST /c7164/rest/api/content/ HTTP/1.1 200 140ms 1691 - PostmanRuntime/7.29.0
Cause
Postman Client is not accessible when calling to Confluence Proxy URL.
Solution
Bypass Load Balancer proxy and call the Rest API to the confluence node:
Add a new connector port 8092 to the <install-confluence-folder>/conf/server.xml on both nodes:
1
2
<Connector port="8092" connectionTimeout="20000" maxThreads="200" minSpareThreads="10"
enableLookups="false" acceptCount="10" URIEncoding="UTF-8" />
The parameter above should be added under port 8090 connectors.
Restart both nodes and change the REST API URL to http://ip-address:8092/rest/api/content/ in Postman. Attempt to send the request to create a new page.
The IP address can be any node IP.
Was this helpful?