Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I want to connect to one or multiple pages in Confluence where other teams update tables that are visible for anyone. I don't want to pay for custom connectors that I know are available.
I'm trying to figure out the best way of doing it but have ran into the following limitations:
- Web API or Web Page doesn't work on either Desktop nor Service ( Have tried Anonymous, Basic and Organizational, is it supposed to work properly with Basic, if yes, is the password supposed to be the one that I have to Confluence? Because that returns "Invalid credentials"
- Start -> ODBC Data Sources 32/64 bit does not give the options that are available in instructions that I find (System DSN is empty)
- And obviously neither ODATA or ODBC works
If anyone has any good ideas i'd greatly appreciate it.
Kindly
/J
Hi @japolo - sorry my instruction were unclear. I didn't mean to swap the order of the Web and Json functions.
I have update my example to show you how the Web.Page function should work instead of the Json.Document function:
In my original example, I am connecting to the Rest API, so the result is a JSON file. The last step will work, while the Web.Page fails. I split the steps up to show this. I also added an extra step to show "Text" string included in the JSON file.
I suspect your Web.Contents using the updated #"Relative Path" step return HTML format instead of JSON. So, #"Web Page" step will work, while the #"Json Document" step will fail.
If both are failing, hopefully, the #"View Context Text" will show something meaningful to help us figure out the actual format of the Web Contents. If we still have an error message, you may need to delete the highlighted below.
let
#"Base URL" = "https://your-domain.atlassian.net/",
#"Relative Path" = "wiki/rest/api/user/current",
#"Get Contents" =
Web.Contents(#"Base URL",
[
RelativePath=#"Relative Path",
Headers=[Accept="application/json"] //delete this row
]
),
#"View Content Text" = Text.FromBinary(#"Get Contents"),
#"Web Page" = Web.Page(#"Get Contents"),
#"Json Document" = Json.Document( #"Get Contents")
in
#"Json Document"
Hi,
Thank you for such thorough explanations.
Unfortunately I can't make it work. I have tried to both remove and leave the row you suggested to delete and none worked, instead it returns the error message that the expected type isn't HTML. I also tried switching the last 2 steps from "Get Contents" to the previous step.
And authorization wise, I'm using the generated token from Atlassian together with the e-mail I use in Confluence & Power BI through Basic Authentication
@japolo - Can I check that you are getting a result when you run it for the API?
"wiki/rest/api/user/current"
Do you know that you can preview each of the "Applied Steps" in Power Query. What you can do is switch between the each step in the below to see when the error occurs.
Actually meant this:
let
#"Base URL" = "https://your-domain.atlassian.net/",
#"Relative Path" = "wiki/rest/api/user/current",
#"Get Contents" =
Web.Contents(#"Base URL",
[
RelativePath=#"Relative Path",
Headers=[Accept="application/json"] //delete this row
]
),
#"View Content Text" = Text.FromBinary(#"Get Contents"),
#"Web Page" = Web.Page(#"Get Contents")
in
#"Web Page"
I think you need to stop using the Json.Document step.
Hi,
Yes, i've tested the different steps. The base URL and Relative Path returns what has already been added after the "=" symbol.
Testing the Get Content Step returns the base URL with the web symbol:
The View Content step returns the HTML code:
The Web page step prompts me to sign in with credentials. I use my e-mail and the created token in atlassian but it tells me the credentials are invalid so I guess the problem starts here. I've tried the "normal" name I have there as well and all kinds of other usernames and passwords as well but none works. Should it not be the username/e-mail with the created token? And i'm using the Basic one.
And the last step prompts that an error reason could be invalid credentials.
Sorry @japolo - I get the same error when trying to read an HTML page from Confluence. So, it looks like there is no access to read the Web.Page Contents when in HTML format. I can see the Binary Text in #"View Content Text" step, but this does not correlate to the objects on the screen because many of these are Java Scriyt(?) objects.
I think Confluence wants you extract the data via the REST API call only. I don't know what syntax you need to extract the page you are calling. Could you please post your question on the Altassian Developer forum (The Atlassian Developer Community). Hopefully, someone can then explain how to translate the Web URL into the Get Content API.
I'll give that a try, thank for trying things and helping out, much appreciated!
Hi @japolo
You can use Web.Contents to access Confluence API. I going to show you an example based on the following:
api-wiki-rest-api-user-current-get
The following should work to retrieve results because the User and Token can be stored in the Data Source Credentials (Basic). However you need to generate token using this Manage API tokens for your Atlassian account | Atlassian Support
let
#"Base URL" = "https://your-domain.atlassian.net/",
#"Relative Path" = "wiki/rest/api/user/current",
#"Get Data" =
Json.Document(
Web.Contents(#"Base URL",
[
RelativePath=#"Relative Path",
Headers=[Accept="application/json"]
]
)
)
in
#"Get Data"
Hi @Daryl-Lynch-Bzy ,
I've tried your instructions but I can't make it work. I've generated a token and tried the it but it doesn't work, i'm getting the following error:
And i replaced the base URL and relative path with the confluence page I wanted to connect to
Not sure what is missing or if it's something else.
Kind regards,
J
Hi @japolo - it appears that you trying to pull a Web.Page instead of Json.Document. Try swapping the these functions to see if this works.
Hi,
I placed web.contents first instead but that returns an error as well:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.