Forum Discussion
Get Reports REST api not working - Showing 400 Bad Request
Hi pratheeban,
Did you use " 'Accept' HTTP header" in the request? Maybe you can try to remove it.
Best Regards,
Dale
I have the same and I have no Accept header. See cURL command obtained from the postman I am using (I have modified it by manually adding "......." to remove id's):
curl -X GET \ https://api.powerbi.com/v1.0/myorg/groups/b931........../reports/7bbf.......... \ -H 'Authorization: Bearer eyJ0e..........' \ -H 'Cache-Control: no-cache'
- v-jiascu-msft8 years agoMicrosoft Employee
Hi luismangahr, pratheeban,
I tested the workaround. Please set the header "Accept" to "None" explicitly. It's None in Python. Please try it and give some feedback.
headers = {"Authorization": token, "Accept": None} r = requests.get(get_url, headers = headers)Best Regards,
Dale- luismangahr8 years agoRegular Visitor
Thanks, v-jiascu-msft, it actually worked! Then, this is a bug, right? In that case, I guess it is identified and to be solved?
Just to add, I found that you can set the "Accept" header to "None", "Noffsfne", "j" or any other invalid value. All valid values I quickly tested (e.g.: "application/json", "message/http" or "text/html") ended up in a "400 Bad Request".
But again, thank you, because this unblocks our research on the Power BI REST api.
- v-jiascu-msft8 years agoMicrosoft Employee
Thanks for sharing, luismangahr. This issue will be fixed. We can work with the workaround for now.
Best Regards,
Dale