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--
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--
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=