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