What is the rest endpoint for confluence cloud?

I've read all the sample documentation and confluence REST API documentation, but can't locate what should go in https://host:port/rest/api/... URIs for Host and Port?

1 answer

Those are provided when Confluence hits your install hook, as described in https://developer.atlassian.com/static/connect/docs/latest/modules/lifecycle.html

Provided the following atlassian-connect.json descriptor:

{
  "installed": "/installed",
  "uninstalled": "/uninstalled",
  "enabled": "/enabled",
  "disabled": "/disabled"
}

Confluence will hit your /installed REST resource with a POST and the following contents:

{
  "key": "installed-addon-key",
  "clientKey": "unique-client-identifier",
  "publicKey": "MIGf....ZRWzwIDAQAB",
  "sharedSecret": "a-secret-key-not-to-be-lost",
  "serverVersion": "server-version",
  "pluginsVersion": "version-of-connect",
  "baseUrl": "https://example.atlassian.net",
  "productType": "jira",
  "description": "Atlassian JIRA at https://example.atlassian.net",
  "serviceEntitlementNumber": "SEN-number",
  "eventType": "installed"
}

So the base url is https://example.atlassian.net.

Now concerning authentication... It's a little difficult because you need to authentify the request from your server to Confluence using JWT and the sharedSecret (above). The explanation is in the Connect documentation, and my intern was able to implement the whole JWT thing in a week (but he wears Superman clothes so he might have a secret).

Whoops, meant this as a comment. I tried that - we browse to ahcwiki.atlassian.net, so I attempted a simple call to the content resource at GET https://ahcwiki.atlassian.net/rest/API/content but got a 500-class service unavailable response. I would have expected unauthorized, since I didn't supply any credentials with the reauest

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

355 views 20 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you