Forum Discussion
Post call on Rest API in M Code
Hi shelly_sethi
Your question is confusing. When you POST data you are typically writing/sending data to something. You are talking about getting data from the API in order to POST it to the API?
Please clairify exactly what you are trying to do.
regards
Phil
Hello Philip,
I want the data from API into Power BI,API will be refreshed daily and it will have one day data.The goal is to extract data daily and put into some table.I am planning to set up incermental refresh on that table based on the daily data update.
I have written below M code but here I have harcoded(in red) the values for testing purposes.How to make these values to be dynamic so that as soon as data changes it should fetch latest records.
let
url = "https://XXXXXi/TXXXX/XXXXX",
headers = [#"Content-Type" = "application/x-www-form-urlencoded", #"Accept" = "application/json"],
postData = "{""serial"":[""B62035173B2540"",""9504BB57FB2613"",""D0E1A667E1951629F"",""C154A4691E62682EE"",""D371A621CE2B6E21""]}",
response = Web.Contents(
url,
[
Headers = headers,
Content = Text.ToBinary(postData)
]
),
jsonResponse = Json.Document(response)
Also if you could suggest ,it is possible to set up incremental refresh on this ...I don't know how will it work.
Thanks
Shelly