Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I get data from an API through a connector.
It works well except for some inputs which return the following error :
DataSource.Error : Web.Contents failed to get contents from « https://XXXXXXXXX » (500) : Internal Server Error
I know that these inputs do have data to be returned (those who don't have data still return an empty table).
Do you have any advice on how to solve this ?
Thanks in advance.
Solved! Go to Solution.
@Anonymous , refer if old solutions can helo
I double clicked on the Source query step in power query and changed the view mode to Default instead of All. That fixed it.
My issue was with a sharepoint list.
I know this has been marked as solved but what worked for me was simply removing the percentage from the Sharepoint File's name
I even expirienced this when my authentication header was not in the right order.
It is always adviced to contact the support team of the API you are trying to connect.
Secondly first try to connect to the api using Postman, if that works you know you have the right header and possible body in place
good example of a platform that takes care and delivers support on their API is mediavalet. You can refer to your api supplier to their website to show how good api documentation looks like. They also deliver an app collection for postman so you know exactly how the api should work.
MediaValet API
now for that specific solution this is the way to go:
I expirenced that if you do this the application/json content type is changed to application/x-www-form-urlencoded by power bi
let
TokenReq = Web.Contents("https://login.mediavalet.com/connect/token", [
Headers = [
#"Content-Type" = "application/x-www-form-urlencoded",
Authorization = Base64cred
],
Content = Text.ToBinary("grant_type=password&username="& Usr & "&password=" & Passw & "&scope=api")
]),
TokenJson = Json.Document(TokenReq),
Token = TokenJson[access_token],
Token2 = Token,
SearchReq = Web.Contents("https://api.mediavalet.com", [
RelativePath = "assets/search",
Headers = [
#"Ocp-Apim-Subscription-Key"= SubscriptionKey,
#"Content-Type" = "application/x-www-form-urlencoded",
Authorization = "Bearer " & Token
],
Content = Json.FromValue([
search = "PietjePuk",
count = 1,
offset = 0,
sort = "record.createdAt D",
searchFields = "attributes",
includeSoftDeleted = true,
filters = "DateUploaded GE 2025-02-22T01:55:39.496Z"
])
]),
Jsonresult = Json.Document(SearchReq)
in
Jsonresult
Hi @Anonymous,
I suggest that you first test the availability of the API directly using one of the other tools. For example, postman. Make sure the headers information is correct. It may be that some of your headers are missing, such as connect-type or User-Agent.
500 statu code is mostly the server encountered an unexpected condition that prevented it from fulfilling the request.
500 Internal Server Error - HTTP | MDN (mozilla.org)
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , refer if old solutions can helo
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 48 | |
| 43 | |
| 26 | |
| 19 |
| User | Count |
|---|---|
| 198 | |
| 126 | |
| 102 | |
| 67 | |
| 50 |