Forum Discussion
Power BI API Dataflow Import Operation
- 7 years ago
import is a bit trickey to get right
here is a sample:
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName=model.json HTTP/1.1
accept: application/json, text/plain, */*
cache-control: no-cache
Authorization: Bearer eyJ0eXAiOi...nQ
User-Agent: PostmanRuntime/7.3.0
accept-encoding: gzip, deflate
content-type: multipart/form-data; boundary=--------------------------613655670645709167014348
content-length: ...
Connection: close
< BODY>
----------------------------613655670645709167014348
Content-Disposition: form-data; name=""; filename="model.json"
Content-Type: application/json
{
"name": "my model",
"version": "1.0",
...
}
----------------------------613655670645709167014348--
I too faced the same problem.
GET operations were successful.
I even tried DELETE dataflow api and it executed fine. So I guess it is not related to permissions.
As per the doc -Power BI dataflow REST API Reference,
The body will contain a model.json file encoded as form data.
I am suspecting issue because of this. I am using POST MAN. I have raw json file.
Can someone tell me how to provide json as encoded form data. Do I have to manually give key value pairs?
Is there easy way to try with POSTMAN tool?
- amos_ortal7 years agoResolver I
import is a bit trickey to get right
here is a sample:
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName=model.json HTTP/1.1
accept: application/json, text/plain, */*
cache-control: no-cache
Authorization: Bearer eyJ0eXAiOi...nQ
User-Agent: PostmanRuntime/7.3.0
accept-encoding: gzip, deflate
content-type: multipart/form-data; boundary=--------------------------613655670645709167014348
content-length: ...
Connection: close
< BODY>
----------------------------613655670645709167014348
Content-Disposition: form-data; name=""; filename="model.json"
Content-Type: application/json
{
"name": "my model",
"version": "1.0",
...
}
----------------------------613655670645709167014348--- Anonymous7 years agoNot applicable
Thanks amos_ortal
Using the same request as in previous tests it is working with Postman app, I am starting C# request tests.
The request URL is incorrect in the Power BI dataflow reference doc, the original:
https://api.powerbi.com/v1.0/myorg/groups/{groupId}/import?datasetDisplayName=<name>.json
The fixed url seems to be:
https://api.powerbi.com/v1.0/myorg/groups/{groupId}/imports?datasetDisplayName=
- saranrajk7 years agoHelper II
Hi,can you please show me how to do it in postman.If will be great if you provide with images
Thanks in advance