You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Trying to use the Confluence Rest API to get some information about some pages shared internally in our company by the links. But only have the tiny URL, there is any way to get the page information from the API with this information?
For example, this is the tinyUrl https://company.com/x/D9KBF , using x/D9KBF to get the page information. I know that when I get the page information there is a field called _links that contains the tinyUrl information.
Was able to get the pageId from the tinyUrl identifier, thanks to this article https://confluence.atlassian.com/confkb/how-to-programmatically-generate-the-tiny-link-of-a-confluence-page-956713432.html
@Ricardo Augusto Brito Dantas Can you please share the code here. I am looking for similar solution but not able to decode tiny url to get the page id. Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
def _get_confluence_page_id_from_tiny_url(self, tiny_url):
page_short_id = tiny_url.split("/")[-1:][0]
page_short_id = (
page_short_id.replace("/", "\n").replace("-", "/").replace("_", "+")
)
padded_id = page_short_id.ljust(11, "A") + "="
decoded_id = base64.b64decode(padded_id)
return struct.unpack("L", decoded_id)[0]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ricardo Augusto Brito Dantas I tried the code but it is giving an error:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's working after changing to
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ricardo Augusto Brito Dantas ,
welcome to the Atlassian community!
are you talking about Confluence API or Confluence Rest API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.