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--
Hi Anonymous,
This request need to register an azure AD app before using, have you finished register before test?
In addition, I found you add other query string to request url, I check on whitepaper but not found it allow additional query parameters:
/v1.0/myorg/groups/{groupId}/imports?datasetdisplayName=<name>.json&type=dataflow
Notice: <name>.json should stored dataflow entity structure defined with json formula.
Reference links:
Developer resources for Power BI dataflows (Preview)
Register an Azure AD app to embed Power BI content
You can also take a look at following video about dataflow:
Regards,
Xiaoxin Sheng
Hi Anonymous,
Thanks for your reply.
Yes, I did the registration process and permission granting. The fact is that I can execute GET commands and the API works as expected.
I added some documentation parameters to the query string I attached in the previous message but in my tests with the documentation url I got this error too.
About the JSON structure, I get it from the export function in PowerBI service, the datasetdisplayName parameter is pointing to that file. The content of the file is sent as form in the request.
About the video, I have watched it carefully but I cant find an explanation about how accessing CDM in default Azure Storage Gen2 (if possible...) can be performed or changing the default Azure Storage Gen2 for a custom Storage.
Thanks again, I will keep you updated.