Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
The REST API I'm querying requires me to login with a username/password and it will return a token, that token then has to be added to the header as x-redlock-auth then the endpoints can be queried.
Without the navigator PowerBI desktop won't allow me past the credtials section, with the navigator it's prompting when trying to load my table.
I've tried adding my own login section:
Prisma = [
TestConnection = (dataSourcePath) => { "Prisma.login" },
Authentication = [
UsernamePassword = [
UsernameLabel = "Prisma API User",
PasswordLabel = "Prisma API Password"
]
],
Label = "Prisma Data Connector"
];
This logs in or returns null:
shared Prisma.login = () =>
let
loginPayload = [
username = Extension.CurrentCredential()[Username],
password = Extension.CurrentCredential()[Password]
],
responseLogin = Web.Contents("https://api3.prismacloud.io", [
RelativePath = "/login",
Headers = [#"Content-Type" = "application/json"],
Content = Json.FromValue(loginPayload),
ManualCredentials = true
]),
token = Json.Document(responseLogin)[token]
in
token;
I also tried spltting out the login path, however the remote API will return an error unless the crecentials are presented in the way above.
My alert function, calls web.contents with:
response = Web.Contents(url, [
RelativePath = path,
Headers = [
#"Content-Type" = "application/json",
#"x-redlock-auth" = token
],
Content = payLoad,
ManualCredentials = true
]),
but the url is the same:
a = GetAllPages("https://api3.prismacloud.io", "/v2/alert", token, Text.ToBinary(alertPayload))
Any ideas what it's upset about?
Hi @Anonymous ,
From the description, there is no problem with the query.
Can log in successfully, but cannot return data?
Could it be an error in the data source path?
See if these will help:
https://docs.microsoft.com/en-us/power-query/samples/trippin/4-paths/readme
https://docs.microsoft.com/en-us/power-query/handlingauthentication#data-source-paths
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Any ideas on this one, thanks in advance.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |