Forum Discussion
Anonymous
7 years agoNot applicable
404 error when loading data to model
Hi All,
I am trying tp pull data from a REST API using the M query as below,
let
Pagination = List.Skip(List.Generate( () => [WebCall=[], Page = 1, Counter=0], // Start Value
each List.Count(Record.FieldNames([WebCall]))>0 or [Counter]=0, // Condition under which the next execution will happen
each [ WebCall = Json.Document(Web.Contents("http://py-soconnect.fusesport.com/api/members/for-season/250/?page="&Text.From([Page])&"")), // retrieve results per call
Page = [Page]+1,
Counter = [Counter]+1// internal counter
]
) ,1),
#"Converted to Table" = Table.FromList(Pagination, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"However the last row is a ERROR record and the error message is as follows,
DataSource.Error: Web.Contents failed to get contents from 'http://py-soconnect.fusesport.com/api/members/for-season/250/?page=246' (404): Not Found
Details:
DataSourceKind=Web
DataSourcePath=http://py-soconnect.fusesport.com/api/members/for-season/250
Url=http://py-soconnect.fusesport.com/api/members/for-season/250/?page=246Because of this I am unable to load the data into the model. Any help will be really appreciated.
Thanks in advance.
2 Replies
- v-danhe-msftMicrosoft Employee
Hi Anonymous,
Based on the code you have posted in your issue, it could work on my side:
Could you have check the code in other computers to have a try?
Regards,
Daniel He
- v-danhe-msftMicrosoft Employee
Hi Anonymous ,
Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered to close this topic?
Regards,
Daniel He