Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
roblaing
Frequent Visitor

POST Request Error

Hi,

I'm really struggling to find what is wrong with my M code to make a POST request. Although I know you would need to know the API to know exactly what is wrong but I just want to check that there is nothing wrong with the way I am making the request? As I am getting a 400. Bad Request error.

For info the API I'm using is Clockify.

roblaing_1-1614879898414.png

I have connected to the API fine for GET requests but can't figure out what I'm doing wrong. And I just want to rule out that I am doing something wrong with the Request rather than misunderstanding the API.

 

Thanks for any help at all

 

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

Hi @roblaing ,
I cannot spot anything obvious.
But you can reduce the risk of typing errors if you use the Json.FromValue function to define the body of your request: Easy POST requests with Power BI and Power Query using Json.FromValue – The BIccountant 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

1 REPLY 1
ImkeF
Super User
Super User

Hi @roblaing ,
I cannot spot anything obvious.
But you can reduce the risk of typing errors if you use the Json.FromValue function to define the body of your request: Easy POST requests with Power BI and Power Query using Json.FromValue – The BIccountant 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors