Forum Discussion
Error 400 power query
hi all,
i am facing an error while trying to refresh a query in power query:
DataSource.Error: OData: Request failed: The remote server returned an error: (400) Bad Request. (You must specify a country or region. )
what can be the issue?
If your URL looks like this (example):
https://api.example.com/odata/Entities…but the API expects:
https://api.example.com/odata/Entities?country=US
7 Replies
- JamieHoldingResolver I
It's pretty much a 'does what it says on the tin' issue.
You are calling some kind of API that requires a country or region e.g.
https://api.example.com/odata/endpoint?country=GB
The API won't function without a specific country.
- MattiaFratelloSuper User
Hi Hussein_charif,
Looks like the OData service you are calling requires a country/region parameter in the URL or query.
You can check in Data Source Settings -> Change Source -> and see if your URL is missing the country.
Proud to Be a SuperUser ✨If this helped, please mark as Answer and give kudos 👍- Hussein_charifHelper V
i have been using the api always as it is, just recently its giving this error
- JamieHoldingResolver I
API may have changed to now require a country - check their documentation in case it was a signficant update.
- cengizhanarslanSuper User
If your URL looks like this (example):
https://api.example.com/odata/Entities…but the API expects:
https://api.example.com/odata/Entities?country=US - v-hashadapuCommunity Support
Hi Hussein_charif , Thank you for reaching out to the Microsoft Community Forum.
We find the answer shared by JamieHolding is appropriate. Can you please confirm if the solution worked for you. It will help others with similar issues find the answer easily.
Thank you JamieHolding for your valuable response.
- v-hashadapuCommunity Support
Hi Hussein_charif , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.