Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have been trying to import data using Trulinks Road Haulage Association, UK(RHA) APIs. Most of the API requests are POST while rest of them being GET. GET APIs have been straightforward while POST requests are posing problems. By Default, Web.Contents sends a GET request while a different approach is needed for POST.
How can I import data via POST request?
Thanks
Solved! Go to Solution.
Including Content in your request makes the Web.Contents perform a POST, for example:
Source = Json.Document(Web.Contents(url,[
Headers = [#"Content-Type"="application/json"],
Content = Text.ToBinary(body)
]
))
I don't know exactly what you need to provide in the request (e.g. API Auth,Headers) as I don' t know the API,but this should get you started. Post back if you need further assistance.
regards
Phil
Proud to be a Super User!
Thank alot, Philip.
Including Content in your request makes the Web.Contents perform a POST, for example:
Source = Json.Document(Web.Contents(url,[
Headers = [#"Content-Type"="application/json"],
Content = Text.ToBinary(body)
]
))
I don't know exactly what you need to provide in the request (e.g. API Auth,Headers) as I don' t know the API,but this should get you started. Post back if you need further assistance.
regards
Phil
Proud to be a Super User!
Is there a way to cater for a PUT request ?
What if the API requires Windows Authentication?
Excel reports back that neither adding "contents" nor adding a method="POST" is allowed for anything but anonymous authentication. How do you post against an API behind Windows Authentication?
If you were building a C# application, it can easily use Windows Authentication to negotiate with the server, and you don't have to manually add the credentials either. It seems that post requests to Windows autorized APIs would be a very common use case in corporate environments, but I have not found a way to do so in Power Query.
@ziyabikram96 , refer if this can help
Suggested in https://community.powerbi.com/t5/Desktop/Pull-data-from-API-using-POST-method-in-Power-BI/td-p/57472...