Forum Discussion
Anonymous
4 years agoNot applicable
Custom Connector with Token Refresh
Hi all, I need to create a Custom Connector to query Prisma Cloud REST API (sadly there isn't already a connector), the platform takes a username and password JSON POST to /login and returns a JWT t...
Anonymous
4 years agoNot applicable
Sadly I'm struggling to get out of the gate lol
The authentication is working correctly and returns me a token, which I've stored in token
loginPayload = [
username = Extension.CurrentCredential()[Username],
password = Extension.CurrentCredential()[Password]
],
loginBody = Json.Document(loginPayload),
responseLogin = Web.Contents("https://api.company.io/login", [
Headers = [#"Content-Type" = "application/json"],
Content = loginBody
]),
token = Json.Document(responseLogin)[token],
I now want to use this to query the endpoint:
responseAlert = Web.Contents("https://company.io/v2/alert", [
Headers = [
#"Content-Type" = "application/json",
#"x-redlock-auth" = token
],
Content = alertBody
]),
a = Json.Document(responseAlert)
However Power Query keeps complaining "The parameter is expected to be of type Text.Type or Binary.Type", I tried wrapping Record.Field and Text.From but I cannot seem to be able to use my extracted JSON value as a header later down the line, any ideas?
- V-lianl-msft4 years agoCommunity Support
Hi Anonymous ,
Hope these will help you:
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.