This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi,
I am trying to fetch data from AWS AppSync Graphql API in power BI . Providing these in headers [Headers=[#"Content-Type"="application/json", #"x-api-key"="xyz"]]
let
qContent = "
{
query MyQuery {
get_id{
id
}
}
}",
cContent = Text.Replace(qContent, Character.FromNumber(34), Character.FromNumber(92) & Character.FromNumber(34)),
pContent = "{ ""query"": "& Character.FromNumber(34) & cContent & Character.FromNumber(34) & " }",
bContent = Text.ToBinary(pContent),
Source = Json.Document(Web.Contents("https://qeenqrsrivdvfnodt4w2ptgt3y.appsync-api.us-east-1.amazonaws.com/graphql", [Headers=[#"Content-Type"="application/json", #"x-api-key"="xyz"],Content=bContent])),
data = Source[data],
get_id = data[get_id],
#"Converted to Table" = Table.FromList(get_id, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id"}, {"id"})
in
#"Expanded Column1"
The same api url and api key works in Postman but in power bi , I get
DataSource.Error: Web.Contents failed to get contents from 'https://qeenqrsrivdvfnodt4w2ptgt3y.appsync-api.us-east-1.amazonaws.com/graphql' (400):
I am using Anonymous Type for credentials.
Does anyone has any idea about this issue?
Have you tried comparing the requests being sent to the endpoint in Postman vs. PBIDesktop using a tool like Fiddler? There must be a difference that's causing the 400 error.
Hi @shreyag12 ,
I found some similar posts which might be helpful to you:
DataSource.Error: Web.Contents failed to get contents from (400): Bad Request
Post API Data Source body format issues
Azure Cost Management - RI Usage Details - 400 Bad Request
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous Thanks for shaing!
I tried changing bContent = Text.ToBinary(pContent), to bContent = Json.FromValue(pContent) as mentioned in Post API Data Source body format issues but still getting the same error.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |