Embed Token - Generate Token

여러 보고서, 데이터 세트 및 대상 작업 영역에 대한 포함 토큰을 생성합니다.

  • 보고서 및 데이터 세트는 관련될 필요가 없습니다.
  • 포함하는 동안 보고서를 데이터 세트에 바인딩할 수 있습니다.
  • 매개 변수로 지정된 targetWorkspaces 작업 영역에서만 보고서를 만들 수 있습니다.

중요

이 API 호출은 고객에 대한 포함 시나리오와 만 관련이 있습니다. 이 API 사용에 대한 자세한 내용은 포함 토큰을 생성할 때 고려 사항을 참조하세요.

사용 권한

필수 범위

요구 사항이 적용되지 않는 한 다음의 모든 사항은 다음과 같습니다.

제한 사항

  • 매개 변수로 지정된 targetWorkspaces 작업 영역에서만 보고서를 만들 수 있습니다.
  • 모든 보고서 및 데이터 세트는 V2 작업 영역에 있어야 합니다.
  • 모든 대상 작업 영역은 V2 작업 영역이어야 합니다.
  • 최대 50개 보고서.
  • 최대 50개의 데이터 세트.
  • 최대 50개의 대상 작업 영역.
  • Azure Analysis Services 또는 Analysis Services 온-프레미스 라이브 연결 보고서의 경우 RLS(행 수준 보안)를 사용하여 포함 토큰을 생성하는 작업은 다시 바인딩된 후 몇 분 동안 작동하지 않을 수 있습니다.

POST https://api.powerbi.com/v1.0/myorg/GenerateToken

요청 본문

Name 형식 Description
datasets

GenerateTokenRequestV2Dataset[]

데이터 세트 목록

datasourceIdentities

DatasourceIdentity[]

SSO(Single Sign-On)를 사용하도록 설정된 데이터 원본에 연결할 때 사용할 ID 목록입니다.

identities

EffectiveIdentity[]

행 수준 보안 규칙에 사용할 ID 목록

lifetimeInMinutes

integer

토큰이 생성된 시간부터 시작하여 토큰의 최대 수명(분)입니다. 토큰의 만료 시간을 단축하는 데 사용할 수 있지만 토큰을 확장하는 데는 사용할 수 없습니다. 값은 양의 정수여야 합니다. 0(0)은 과 동일 null하며 기본 만료 시간을 설정합니다.

reports

GenerateTokenRequestV2Report[]

보고서 목록

targetWorkspaces

GenerateTokenRequestV2TargetWorkspace[]

포함 토큰에서 저장할 수 있는 작업 영역 목록

응답

Name 형식 Description
200 OK

EmbedToken

확인

예제

Example of generating an embed token for a dataset and two reports example. Only one of the reports can be edited.
Example of generating an embed token for a paginated report which has a Power BI dataset as a datasource. The ID of the dataset must be specified in the request. The report and dataset can each have its own identity
Example of generating an embed token for a paginated report with a data source identity
Example of generating an embed token for a paginated report with multiple data source identities and a single identity blob
Example of generating an embed token for a paginated report with multiple data source identities and multiple identity blobs
Example of generating an embed token for a Power BI report with a dataset which is connected with DirectQuery to another Power BI dataset. All related dataset IDs must be specified in the request with 'xmlaPermissions' set to 'ReadOnly'. IdentityBlobs for all SSO-enabled data sources must be provided in the 'datasourceIdentities' array
Example of generating an embed token for a Power BI report with a paginated visual. The paginated report ID ('...4850') of the paginated visual must be included in the 'reports' section of the request.
Example of generating an embed token for two datasets with RLS identities and a single report with read-only permissions. The embed token lets you view the report, which is dynamically bound to two different datasets.
Example of generating an embed token that expires no later than ten minutes from the API call

Example of generating an embed token for a dataset and two reports example. Only one of the reports can be edited.

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "datasets": [
    {
      "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
    }
  ],
  "reports": [
    {
      "allowEdit": true,
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    },
    {
      "id": "759908bb-ead8-4a43-9645-7ffbf921c68d"
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "49ae3742-54c0-4c29-af52-619ff93b5c80",
  "expiration": "2018-07-29T17:58:19Z"
}

Example of generating an embed token for a paginated report which has a Power BI dataset as a datasource. The ID of the dataset must be specified in the request. The report and dataset can each have its own identity

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "datasets": [
    {
      "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
      "xmlaPermissions": "ReadOnly"
    }
  ],
  "reports": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    }
  ],
  "identities": [
    {
      "username": "john@contoso.com",
      "roles": [
        "sales"
      ],
      "datasets": [
        "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
      ]
    },
    {
      "username": "john@contoso.com",
      "reports": [
        "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
      ]
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "49ae3742-54c0-4c29-af52-619ff93b5c80",
  "expiration": "2028-07-29T17:58:19Z"
}

Example of generating an embed token for a paginated report with a data source identity

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "reports": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    }
  ],
  "datasourceIdentities": [
    {
      "datasources": [
        {
          "datasourceType": "Sql",
          "connectionDetails": {
            "server": "New-Sql-Server",
            "database": "New-Sql-Database"
          }
        }
      ],
      "identityBlob": "eyJ0eX....AAA="
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "49ae3742-54c0-4c29-af52-619ff93b5c80",
  "expiration": "2028-07-29T17:58:19Z"
}

Example of generating an embed token for a paginated report with multiple data source identities and a single identity blob

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "reports": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    }
  ],
  "datasourceIdentities": [
    {
      "datasources": [
        {
          "datasourceType": "Sql",
          "connectionDetails": {
            "server": "New-Sql-Server",
            "database": "New-Sql-Database"
          }
        },
        {
          "datasourceType": "MySql",
          "connectionDetails": {
            "server": "New-MySql-Server",
            "database": "New-MySql-Database"
          }
        }
      ],
      "identityBlob": "eyJ0eX....AAA="
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "49ae3742-54c0-4c29-af52-619ff93b5c80",
  "expiration": "2028-07-29T17:58:19Z"
}

Example of generating an embed token for a paginated report with multiple data source identities and multiple identity blobs

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "reports": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    }
  ],
  "datasourceIdentities": [
    {
      "datasources": [
        {
          "datasourceType": "Sql",
          "connectionDetails": {
            "server": "New-Sql-Server",
            "database": "New-Sql-Database"
          }
        }
      ],
      "identityBlob": "eyJ0eX....AAA="
    },
    {
      "datasources": [
        {
          "datasourceType": "MySql",
          "connectionDetails": {
            "server": "New-MySql-Server",
            "database": "New-MySql-Database"
          }
        }
      ],
      "identityBlob": "eyJ0dW....AAA="
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "49ae3742-54c0-4c29-af52-619ff93b5c80",
  "expiration": "2028-07-29T17:58:19Z"
}

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "datasets": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd",
      "xmlaPermissions": "ReadOnly"
    },
    {
      "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
      "xmlaPermissions": "ReadOnly"
    }
  ],
  "reports": [
    {
      "id": "f904e89a-7ebe-4aa0-8647-e409063b4850"
    }
  ],
  "datasourceIdentities": [
    {
      "datasources": [
        {
          "datasourceType": "Sql",
          "connectionDetails": {
            "server": "Best-Sql-Server",
            "database": "Database3"
          }
        }
      ],
      "identityBlob": "eyJ0eX....AAA="
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "ab4d49ae-c054-4c29-af52-93b5c80619ff",
  "expiration": "2022-06-10T12:41:11Z"
}

Example of generating an embed token for a Power BI report with a paginated visual. The paginated report ID ('...4850') of the paginated visual must be included in the 'reports' section of the request.

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "datasets": [
    {
      "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
    }
  ],
  "reports": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    },
    {
      "id": "f904e89a-7ebe-4aa0-8647-e409063b4850"
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "49ae3742-54c0-4c29-af52-619ff93b5c80",
  "expiration": "2018-07-29T17:58:19Z"
}

Example of generating an embed token for two datasets with RLS identities and a single report with read-only permissions. The embed token lets you view the report, which is dynamically bound to two different datasets.

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "datasets": [
    {
      "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
    },
    {
      "id": "e75afc47-1150-45e0-aba7-4eb04e4876e5"
    }
  ],
  "reports": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    }
  ],
  "identities": [
    {
      "username": "john@contoso.com",
      "roles": [
        "sales"
      ],
      "datasets": [
        "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
      ]
    },
    {
      "username": "iris@contoso.com",
      "roles": [
        "executive"
      ],
      "datasets": [
        "e75afc47-1150-45e0-aba7-4eb04e4876e5"
      ]
    }
  ]
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "4b76f5ed-5a06-4150-8d1b-60f8e4c186f4",
  "expiration": "2028-07-29T17:58:19Z"
}

Example of generating an embed token that expires no later than ten minutes from the API call

Sample Request

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "datasets": [
    {
      "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
    }
  ],
  "reports": [
    {
      "id": "b2e49b01-2356-4456-bfb9-3f4c2bc4ddbd"
    }
  ],
  "identities": [
    {
      "username": "john@contoso.com",
      "roles": [
        "sales"
      ],
      "datasets": [
        "cfafbeb1-8037-4d0c-896e-a46fb27ff229"
      ]
    }
  ],
  "lifetimeInMinutes": 10
}

Sample Response

{
  "token": "H4sI....AAA=",
  "tokenId": "4b76f5ed-5a06-4150-8d1b-60f8e4c186f4",
  "expiration": "2028-07-29T17:58:19Z"
}

정의

Name Description
DatasourceConnectionDetails

Power BI 데이터 원본 연결 세부 정보입니다. 데이터 원본 가져오기 또는 그룹 내 데이터 원본 가져오기의 예제를 참조하세요.

DatasourceIdentity

SSO(Single Sign-On)를 사용하도록 설정된 DirectQuery 데이터 원본을 연결하기 위한 효과적인 ID입니다.

DatasourceSelector

연결 세부 정보로 단일 데이터 원본을 고유하게 식별하는 개체입니다.

EffectiveIdentity

사용자 ID 및 역할을 정의합니다. 자세한 내용은 Power BI Embedded 있는 행 수준 보안을 참조하세요.

EmbedToken

Power BI 포함 토큰

GenerateTokenRequestV2

Power BI 토큰 생성 요청 V2

GenerateTokenRequestV2Dataset

GenerateTokenRequestV2의 데이터 세트 개체

GenerateTokenRequestV2Report

GenerateTokenRequestV2의 보고서 개체

GenerateTokenRequestV2TargetWorkspace

GenerateTokenRequestV2의 작업 영역 개체

IdentityBlob

ID를 지정하기 위한 Blob입니다. Azure SQL DirectQuery 연결이 있는 데이터 세트에 대해서만 지원됩니다.

XmlaPermissions

XMLA 권한

DatasourceConnectionDetails

Power BI 데이터 원본 연결 세부 정보입니다. 데이터 원본 가져오기 또는 그룹 내 데이터 원본 가져오기의 예제를 참조하세요.

Name 형식 Description
account

string

연결 계정

classInfo

string

연결 클래스 정보

database

string

연결 데이터베이스

domain

string

연결 도메인

emailAddress

string

연결 전자 메일 주소

kind

string

연결 종류

loginServer

string

연결 로그인 서버

path

string

연결 경로

server

string

연결 서버

url

string

연결 URL

DatasourceIdentity

SSO(Single Sign-On)를 사용하도록 설정된 DirectQuery 데이터 원본을 연결하기 위한 효과적인 ID입니다.

Name 형식 Description
datasources

DatasourceSelector[]

이 ID가 적용되는 데이터 원본의 배열입니다.

identityBlob

string

ID를 지정하기 위한 Blob입니다.

DatasourceSelector

연결 세부 정보로 단일 데이터 원본을 고유하게 식별하는 개체입니다.

Name 형식 Description
connectionDetails

DatasourceConnectionDetails

데이터 원본 연결 세부 정보입니다. 페이지를 매긴 보고서에 대한 데이터 원본 가져오기 및 Powerbi 보고서 API에 대한데이터 원본 가져오기를 사용하여 연결 세부 정보를 가져올 수 있습니다.

datasourceType

string

데이터 원본의 형식입니다.

데이터 원본의 API 이름
ActiveDirectory AdobeAnalytics AdoDotNet
AnalysisServices AzureBlobs AzureDataLakeStorage
AzureMarketplace AzureTables BizTalk
CDPA CustomConnector CustomHttpApi
DB2 Essbase EventHub
Excel Exchange 내선 번호
Facebook 파일 폴더
GoogleAnalytics Hdfs HDInsight
Informix MQ MySql
OData ODBC OleDb
Oracle PostgreSql PowerQueryMashup
PubNub Salesforce SAPBW
SAPBWMessageServer SapErp SAPHana
SharePoint SharePointDocLib SharePointList
Sql Sybase Teradata
UIFlow

EffectiveIdentity

사용자 ID 및 역할을 정의합니다. 자세한 내용은 Power BI Embedded 있는 행 수준 보안을 참조하세요.

Name 형식 Description
auditableContext

string

EffectiveIdentity 감사 가능한 컨텍스트입니다. 이 매개 변수가 제공되고 비어 있지 않으면 EffectiveIdentity에 대한 감사를 사용하도록 설정하고 해당 값은 감사 레코드의 사용자 이름으로 설정됩니다. 그렇지 않으면 EffectiveIdentity 컨텍스트가 GenerateToken 감사 레코드에서 생략됩니다.

customData

string

행 수준 보안 규칙을 적용하는 데 사용되는 사용자 지정 데이터입니다. Azure Analysis Services 모델 및 클라우드 모델에 대한 라이브 연결에 대해서만 지원됩니다.

datasets

string[]

이 ID가 적용되는 데이터 세트의 배열입니다.

identityBlob

IdentityBlob

ID를 지정하는 Blob 입니다. Azure SQL DirectQuery 연결이 있는 데이터 세트에 대해서만 지원됩니다.

reports

string[]

이 ID가 적용되는 보고서의 배열입니다. 페이지를 매긴 보고서에 대해서만 지원됩니다.

roles

string[]

RLS 규칙을 적용하는 토큰 내의 RLS(행 수준 보안) 역할 배열입니다. ID에는 최대 50개의 역할이 포함될 수 있습니다. 역할에는 를 제외한 ,모든 문자가 포함될 수 있으며 길이가 50자를 초과하면 안됩니다.

username

string

행 수준 보안 규칙을 적용하는 토큰 내의 유효 사용자 이름입니다. 온-프레미스 모델의 경우 사용자 이름에 영숫자 또는 다음 문자 ., , , _-, !, #~^, \\, @가 포함될 수 있습니다. 클라우드 모델의 경우 사용자 이름에 ASCII 문자가 포함될 수 있습니다. 두 모델 모두 사용자 이름 길이가 256자를 초과하면 안 되며 사용자 이름에 공백이 없어야 합니다.

EmbedToken

Power BI 포함 토큰

Name 형식 Description
expiration

string

토큰 만료 날짜 및 시간(UTC)

token

string

포함 토큰

tokenId

string

고유 토큰 ID입니다. 감사 로그를 통해 토큰 ID를 사용하여 토큰을 사용하는 작업과 생성 작업의 상관 관계를 지정할 수 있습니다.

GenerateTokenRequestV2

Power BI 토큰 생성 요청 V2

Name 형식 Description
datasets

GenerateTokenRequestV2Dataset[]

데이터 세트 목록

datasourceIdentities

DatasourceIdentity[]

SSO(Single Sign-On)를 사용하도록 설정된 데이터 원본에 연결할 때 사용할 ID 목록입니다.

identities

EffectiveIdentity[]

행 수준 보안 규칙에 사용할 ID 목록

lifetimeInMinutes

integer

토큰이 생성된 시간부터 시작하여 토큰의 최대 수명(분)입니다. 토큰의 만료 시간을 단축하는 데 사용할 수 있지만 확장할 수는 없습니다. 값은 양의 정수여야 합니다. 0(0)은 과 같 null으며 기본 만료 시간을 설정합니다.

reports

GenerateTokenRequestV2Report[]

보고서 목록

targetWorkspaces

GenerateTokenRequestV2TargetWorkspace[]

포함 토큰에서 저장할 수 있는 작업 영역 목록

GenerateTokenRequestV2Dataset

GenerateTokenRequestV2의 데이터 세트 개체

Name 형식 Description
id

string

데이터 세트 ID

xmlaPermissions

XmlaPermissions

XMLA 권한

GenerateTokenRequestV2Report

GenerateTokenRequestV2의 보고서 개체

Name 형식 Description
allowEdit

boolean

생성된 포함 토큰이 보고서 편집을 지원하는지 여부

id

string

보고서 ID

GenerateTokenRequestV2TargetWorkspace

GenerateTokenRequestV2의 작업 영역 개체

Name 형식 Description
id

string

작업 영역 ID

IdentityBlob

ID를 지정하기 위한 Blob입니다. Azure SQL DirectQuery 연결이 있는 데이터 세트에 대해서만 지원됩니다.

Name 형식 Description
value

string

Azure SQL 대한 OAuth 2.0 액세스 토큰

XmlaPermissions

XMLA 권한

Name 형식 Description
Off

string

생성된 포함 토큰이 데이터 세트의 XMLA 엔드포인트에 대한 액세스 권한을 부여하지 않음을 나타냅니다.

ReadOnly

string

생성된 포함 토큰이 데이터 세트의 XMLA 엔드포인트에 대한 읽기 액세스 권한을 부여했음을 나타냅니다.