Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I have a problem getting data from REST API. Here's some background:
I'm trying to get data from REST API with Web.Contents. This API requires md5 hashed code and each call has to be unique (hashed code can be used only once). URL and md5 hashed code are generated in Power BI before calling the API and everything is fine so far. But each Web.Contents call returns error message REQUEST_NOT_UNIQUE: Unique hashed code is already used.
Next lines are from Power BI log. It seems that Web.Contents is executed twice.
Line 2384: DataMashup.Trace Information: 24579 : {"Start":"2017-12-19T11:43:53.4206534Z","Action":"Engine/IO/Web/Request/GetResponse","HostProcessId":"18160","RequestMethod":"GET","RequestUri":"XXXXX?StartDate=2010-01-01&EndDate=2017-12-01","RequestHasContent":"False","RequestHasHeaders":"True","RequestHasTimeout":"True","UseCache":"True","ResponseStatusCode":"200","ProductVersion":"2.53.4954.481...
Line 2385: DataMashup.Trace Information: 24579 : {"Start":"2017-12-19T11:43:53.6923237Z","Action":"Engine/IO/Web/Request/GetResponse","HostProcessId":"18160","RequestMethod":"GET","RequestUri":"XXXXX?StartDate=2010-01-01&EndDate=2017-12-01","RequestHasContent":"False","RequestHasHeaders":"True","RequestHasTimeout":"True","UseCache":"True","ResponseStatusCode":"200","ProductVersion":"2.53.4954.481...
Any ideas how to fix this or is there any possible workarounds to get the data from API?
Solved! Go to Solution.
This one is solved. API was limited to max 500 rows per call and and error message for slightly misleading.
Can you post your M code?
Here is the M code.
Timestamp, md5 hash and end date come from SQL Server and each list contains only one value. Other values come from static parameters.
If I change parameter values then I get different error message about incorrect http headers / values. So it seems that the URL generated right, but for some reason I always get error message about not unique request.
let
sender = "PBI",
customerID = vCustomerId,
partnerID = vPartnerId,
kieli = vKieli,
orga = vYTunnus,
trID = "-tositteet",
Source = Xml.Tables(Web.Contents("https://yyyy.com/nnn.nv",
[Headers=[
#"X-Authentication-Sender"=sender,
#"X-Authentication-CustomerId"=customerID,
#"X-Authentication-PartnerId"=partnerID,
#"X-Authentication-Timestamp"=List.First(timestamp),
#"X-Interface-Language"=kieli,
#"X-Organisation-ID"=orga,
#"X-Authentication-TransactionId"=List.First(timestamp) & trID,
#"X-Authentication-MAC"=List.First(md5_hash)],
Query=[StartDate="2010-01-01", EndDate=List.First(endDate)]
])),
#"Expanded Table" = Table.ExpandTableColumn(Source, "Table", {"Status", "TimeStamp"}, {"Table.Status", "Table.TimeStamp"}),
#"Expanded Table.Status" = Table.ExpandTableColumn(#"Expanded Table", "Table.Status", {"Element:Text"}, {"Table.Status.Element:Text"})
in
#"Expanded Table.Status"
This one is solved. API was limited to max 500 rows per call and and error message for slightly misleading.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |