Vous êtes sur la page 1sur 25

Power BI dataflow REST API

reference
Dataflow operations
1. Import Dataflow (Preview)
The Import Dataflow operation creates a new Dataflow from a JSON schema definition and returns
the Dataflow ID and the properties of the Dataflow created. A Dataflow can be created in a Group.

Required scope: [Scope] Dataflow.ReadWrite.All

To set the permissions scope, see Register an app.

Request
POST

/v1.0/myorg/groups/{groupId}/import?datasetDisplayName=<name>.json

Query string parameter

Name Description Data Type

displayName The display name of the dataflow that will be string


presented in the workspace after import. The
string given as the display name will also be added
as the default description of the dataflow artifact.

type To create a new dataflow artifact, pass the string string


“dataflow” in that parameter

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.
Uri parameter

Name Description Data Type

groupId Group GUID to import the dataflow definition file to string

Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ

The body will contain a DPLX file encoded as form data.

Response

Status code

Code Description

202 Accepted

400 Bad request.

403 Not authorized.

500 Internal Server Error

Location header
N/A

Content-Type

Body schema
{
"id":"<guid>"
}

Body example

{
"id":"51e47fc5-48fd-4826-89f0-021bd3a80ab "
}
2. Export Dataflow Definition (Preview)

The Export Dataflow Definition operation retrieves a Dataflow definition as a JSON file (.DPLX) based
on its ID

Required scope: [Scope] Dataflow.Read.All

To set the permissions scope, see Register an app.

Request
GET

/v1.0/myorg/groups/{groupId}/dataflows/{dataflowId}

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

Name Description Data Type

groupId Group guid in which the dataflow id located string

dataflowId Dataflow guid to export string


Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ

Response
A json containing the dataflow definition file

Status code

Code Description

200 OK

400 Bad request.

403 Not authorized.

500 Internal Server Error

Location header
N/A
3. Delete Dataflow (Preview)

The Delete Dataflow operation deletes a dataflow from the CDS for Analytics storage, including its
definition file and actual model.

Required scope: [Scope] Dataflow.ReadWrite.All

To set the permissions scope, see Register an app.

Request
DELETE /v1.0/myorg/groups/{groupId}/dataflows/{dataflowId}

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

Name Description Data Type

groupId Group guid in which the Dataflow is located string

dataflowId Dataflow guid to delete string

Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ

Response
Status code

Code Description

200 Delete request was accepted

401 Unauthorized.

404 Not Found

500 Internal Server Error


4. Get All Dataflows (Preview)

The Get All Dataflows operation retrieves a list of all dataflows in the user's group (workspace)

Required scope: [Scope] Dataflow.Read.All

To set the permissions scope, see Register an app.

Request
GET

/v1.0/myorg/groups/{groupId}/dataflows/

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

Name Description Data Type

groupId The group guid to retrieve the dataflow definition files from string

Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ

Response
A json containing the metadata of the dataflows in the group
Status code

Code Description

200 OK

400 Bad request.

403 Not authorized.

500 Internal Server Error

Location header
N/A

Content-Type
application/json

Body schema
{
"odata.context": "string",
"value": [
{
"objectId": "string",
"name": "string",
"description": "string"
}
]
}

Body example
{
"@odata.context": "https://api.powerbi.com/v1.0/myorg/$metadata#
dataflows",
"value": [
{
"objectId": "bd32e5c0-363f-430b-a03b-5535a4804b9b",
"name": "AdventureWorks",
"description": "Our Adventure Works "
}
]
}
5. Available features (Preview)

The Available Features operation indicates the capabilities open in the tenant for the current user

Required scope: [Scope] Dataflow.Read.All

To set the permissions scope, see Register an app.

Request
GET

/v1.0/myorg/availableFeatures

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

None.

Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ

Response
A json containing the list of features and their state
Status code

Code Description

200 OK

400 Bad request.

403 Not authorized.

500 Internal Server Error

Location header
N/A

Content-Type
application/json

Body schema
{
"@odata.context":"https://api.powerbi.com/v1.0/myorg/$metadata#AvailableFeat
ures",
"name":"string",
"state":"string",
"extendedState":"string",
"additionalInfo":
{
"usage":"int"
}
}

Body example
{
"@odata.context": "
https://api.powerbi.com/v1.0/myorg/$metadata#Microsoft.PowerBI.ServiceContra
cts.Api.AvailableFeatures",
"features": [
{
"name": "cdsa",
"state": "Enabled | Disabled",
"extendedState": "Enabled | DisabledByAdmin | UserNotLicensed",
"additionalInfo": null
},
{
"name": "embedTrial",
"state": "Enabled | Disabled",
"extendedState": "Enabled | DisabledByAdmin | UserNotLicensed",
"additionalInfo": {
"usage": 0
}
}
}
6. Get Dataflow Data Sources (Preview)

The Get Dataflows Data Sources retrieves a list of all of the Data Sources defined in the dataflow
definition file for a given dataflow.

Required scope: [Scope] Dataflow.Read.All

To set the permissions scope, see Register an app.

Request
GET

/v1.0/myorg/groups/{groupId}/dataflows/{dataflowId}/datasources

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

Name Description Data Type

groupId Group guid string

dataflowId Dataflow guid string

Header
Authorization: Bearer eyJ0eX ... FWSXfwtQ
Response
A list of data sources.

Status code

Code Description

200 OK

400 Bad request.

403 Not authorized.

500 Internal Server Error

Location header
N/A

Content-Type
application/json

Body schema

{
"datasourceId" : "<Guid>",
"gatewayId": "<Guid>",
"datasourceType":"Sql",
"connectionDetails":
{
"server":"MyServer",
"database":"MyDatabase"
}
}

Body example
{
"datasourceId" : "51e47fc5-48fd-4826-89f0-021bd3a80abd",
"gatewayId": "51e47fc5-48fd-4826-89f0-021bd3a80abd",
"datasourceType":"Sql",
"connectionDetails":
{
"server":"MyServer",
"database":"MyDatabase"
}
}
7. Create Dataflow Reference to external storage (Preview)

The Create Dataflow Reference operation creates a new dataflow artifact in the Power BI service that is
referencing a dataflow hosted in an external storage. The external storage includes both the dataflow
definition file and the dataflow data.

Required scope: [Scope] Dataflow.ReadWrite.All

To set the permissions scope, see Register an app.

Request
POST

/v1.0/myorg/groups/{groupId}/dataflows/createReference

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

Name Description Data Type

groupId Group guid string

Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ

Body schema
For a list of Power BI REST data types, see Supported data types.

{
"name": string,
"description": string,
"subscriptionId": guid,
"resourceGroupName": string,
"vaultName": string,
"secretPath": string
}

Body example

{
"name": "Dataflow Reference",
"description": "Dataflow description",
"subscriptionId": "51e47fc5-48fd-4826-89f0-021bd3a80abd",
"resourceGroupName":"resourceGroupName",
"vaultName":"vaultName",
"secretPath": "secretPath"
}

Response
A json containing guid for the created dataflow reference

Status code

Code Description

200 OK

400 Bad request


Code Description

403 Not authorized

500 Internal Server Error

Location header
N/A

Content-Type
Application/json

Body schema

{
"id":"<guid>"
}

Body example

{
"id": “075de301-cfff-4808-a1a2-4ea749796695”
}
8. Update Dataflow Schedule (Preview)

The Update Dataflow Schedule operation updates the Dataflow refresh schedule configuration.

Required scope: [Scope] Dataflow.ReadWrite.All

To set the permissions scope, see Register an app.

Request
PATCH

/v1.0/myorg/groups/{groupId}/dataflows/{dataflowId}/refreshesSchedule

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

Name Description Data Type

groupId Group guid string

dataflowId Dataflow guid string

Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ
Body schema

For a list of Power BI REST data types, see Supported data types.

{
"value": {
"days": string[],
"times": string[],
"enabled": boolean,
"localTimeZoneId": string
}
}

Body example

{
"value": {
"days": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"times": [
"10:00",
"16:00"
],
"enabled": true,
"localTimeZoneId": "UTC"
}
}

Response
Status code

Code Description

200 OK

400 Bad request

403 Not authorized

500 Internal Server Error

Location header
N/A
9. Refresh Dataflow (Preview)

The Refresh Dataflow operation triggers a dataflow refresh action.

Required scope: [Scope] Dataflow.ReadWrite.All

To set the permissions scope, see Register an app.

Request
Post

/v1.0/myorg/groups/{groupId}/dataflows/{dataflowId}/refreshes

Query string parameter

None.

Groups
Groups are a collection of unified Azure Active Directory groups that the user is a member of and is
available in the Power BI service. These are referred to as app workspaces within the Power BI service. To
learn how to create a group, see Create an app workspace.

Uri parameter

Name Description Data Type

groupId Group guid string

dataflowId Dataflow guid string

Header
Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ
Response

Status code

Code Description

200 OK

400 Bad request

403 Not authorized

500 Internal Server Error

Location header
N/A

Vous aimerez peut-être aussi