Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
3 years ago
Solved

API Query Error - Unexpected error in JSON input

Hi all,   I'm trying to generate an authentication token from an API. The first step in using the API is to generate an API token by sending two parameters in the body of a POST request to the API....
  • Syndicate_Admin's avatar
    3 years ago

    I received some help outside of this forum and was able to resolve the issue. The code that worked correctly follows:

     

    let
    url = "https://xxx.xxx.com/api/auth",
    headers = [#"Content-Type"="application/json"],
    body = "{ ""Param1"": ""XXX-XXX-XXX"", ""Param2"": ""YYY-YYY-YYY""}",
    Source = Text.FromBinary(Web.Contents(url,[ Content = Text.ToBinary(body), Headers = headers ]))
    in
    Source