Forum Discussion
Anonymous
9 years agoNot applicable
API Import 400 Bad Request Error when uploading pbix file
Hello, I have an application where we want to show PowerBI Premium reports in our application. However, before that happens, we also need to upload PBIX reports using our application. I have be...
- 9 years ago
For new reports just remove the name conflict parameter
Anonymous
9 years agoNot applicable
Yea, i ended up figuring that out late today. Sorry for not updating the thread. I appreciate all your help. I wpuld have struggled a lot more than I did without it.
ddavid
8 years agoNew Member
Hi Anonymous ,
I am getting <Response [400]>, when I run this code. Any idea what is wrong ?
Thanks in advance.
import requests
values = """
-----BOUNDARY
Content-Disposition: form-data; name="mypbix"; filename="mypbix.pbix"
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
{PBIX binary data}
-----BOUNDARY"""
headers = {
'Content-Type': 'multipart/form-data; boundary=---BOUNDARY',
'Authorization': 'Bearer <access_token>'
}
request = requests.post('https://api.powerbi.com/v1.0/myorg/groups/<group_id>/imports?datasetDisplayName=ProductOrder', data=values, headers=headers)