Forum Discussion

Zack92's avatar
Zack92
Icon for Helper III rankHelper III
2 years ago

Power BI POST Request is not working

Hey there!

Could someone assist me in setting up a Power BI POST Request? I've tackled plenty of REST requests before (I am not cord-savvy), but POST is throwing me for a loop. I've tried some code I found, but it's not cooperating. Any help would be awesome, thanks!

let
    URL = "https://api2.clarizen.com/v2.0/services/authentication/login",
    Body = Json.FromValue([
        userName = "[email protected]",
        Password = "APItest@ssword"
    ]),
    Headers = [
        #"Content-Type" = "application/json"
    ],
    Response = Web.Contents(
        URL,
        [
            Content = Body,
            Headers = Headers,
            Method = "POST"
        ]
    ),
    ResponseText = Text.FromBinary(Response)
in
    ResponseText

Error

Expression.Error: 'Method' isn't a valid Web.Contents option. Valid options are:
ApiKeyName, Content, ExcludedFromCacheKey, Headers, IsRetry, ManualStatusHandling, Query, RelativePath, Timeout

Any other easy way we can do this? Response will be session Key 
Thank you