Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Getting 400 error on HTTP call to Sharepoint online

Hi all,

I am trying to call Sharepoint REST API with MS Flow but I am getting always the same error "HTTP Error 400. The request hostname is invalid."

See the capture below:


It doesn't matter to wich endpoint I try to access or how many times I register my app (in Sharepoint and in my Azure tenant) I always get the same error. I have followed many blog posts like this : or answers in this same forum like this one:

The token is well retrieved and passed to the url, is not a permissions issue because then I will get a different error (and because this same app credentials I used before to access to Sharepoint through CSOM methods and Powershell).

And of course the url is working perfectly as simple as it is.

This is how I parse the token and token type and I buid the http call:





 I would appreciate so much any thinking that you could have!

Thanks you

Super User
Super User

Re: Getting 400 error on HTTP call to Sharepoint online

HI @MariaL 

I just stumbled on your request. You've been waiting a while for a reply.

Were you able to solve it? Can you post the solution so that we can all learn from it?

If you still need help, please let me know what changed.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.


Helpful resources


Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.


Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,914)