Web.Content parameters from Postman dump

I got specifics from an API service I need to query (it’s an ML algorithm endpoint) in JSON exported from Postman. Nothing else but this is the documentation I can refer to.

I’ve been through Web.Content documentation in Microsoft (very poor indeed) this [link] also referred (https://eriksvensen.wordpress.com/2014/09/15/specifying-json-query-in-power-query-example-statistics-sweden/). This Chris Webb video warns me it a complex topic.

So my attempts stopped here. Is there any way to build the Web.Content call starting from a Postman export?

let

content =
"{
““header””: [
{
““key””: ““request-source””,
““value””: ““mlaas-api””
}
],
““examples””: [
{
““Input1"”: ““The service(s) NETBACKUP PROXY SERVICE have been automatically restarted more than 5 times in a 24h period. Please investigate if this is expected behaviour.””
}
]
}”,

Source = Json.Document(Web.Contents(“https://fake.url.com/service/mlaas/classification/” & “dataModelId=175” & “apiKey=EE342B345-30B7-4023-FAFA-768A5CB3E0”, [Content=Text.ToBinary(content)])),
#“Converted to Table” = Record.ToTable(Source)
in
#“Converted to Table”

fake.postman_collection.json (1.3 KB)

Hi @Roberto , we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.
  • When posting a topic with formula make sure that it is correctly formatted to preformated text </>.
  • Use the proper category that best describes your topic
  • Provide as much context to a question as possible.
  • Include demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline https://forum.enterprisedna.co/t/how-to-use-the-enterprise-dna-support-forum/3951. Not adhering to it may sometimes cause delay in getting an answer.

after some trying, I got what I wanted!
In the header section adding the Content Type mad the trick.

Microsoft should add some more documentation to the Web.Contents function anyway.

Thanks All!

Roberto

body =
"{
““examples””: [
{
““Input1"”: ““password reset””
}
]
}”,

output = Web.Contents(url, [Headers=[#"Content-Type"="application/json"], Content=Text.ToBinary(body)]),
// 
Source = Json.Document(output)

in
Source