rest-api-automation
БесплатноБез исполняемых скриптовНе проверенPower BI REST API and Fabric REST API automation. PROACTIVELY activate for: (1) calling Power BI REST APIs, (2) embed-token generation (App Owns Data, User…
от JosiahSiegel★ 67 звёзд на GitHubОб этом скилле
Power BI REST API and Automation
Overview
The Power BI REST API provides programmatic access for embedding, administration, dataset management, and automation. The base URL is https://api.powerbi.com/v1.0/myorg/ for user context or https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/ for workspace context.
Authentication
Service Principal (Recommended for Automation)
- Register app in Azure AD: Azure Portal > App registrations > New registration
- Create client secret: Certificates & secrets > New client secret
- Grant Power BI permissions: API permissions > Add > Power BI Service
- Enable in Power BI Admin: Tenant settings > Allow service principals to use APIs > add security group
- Add SP to workspace: Workspace > Access > Add the app as Member or Contributor
Get access token:
curl -X POST "https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id={clientId}&client_secret={secret}&scope=https://analysis.windows.net/powerbi/api/.default"
PowerShell:
$body = @{
grant_type = "client_credentials"
client_id = $clientId
client_secret = $clientSecret
scope = "https://analysis.windows.net/powerbi/api/.default"
}
$token = (Invoke-RestMethod -Uri "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token" `
-Method Post -Body $body).access_token
Master User (Legacy, Not Recommended)
Uses a real user account with username/password grant. Requires Pro/PPU license. Subject to MFA and Conditional Access issues. Avoid for production.
API Operation Groups
| Group | Base Path | Purpose |
|---|---|---|
| Datasets | /datasets |
Manage semantic models, refresh, parameters |
| Reports | /reports |
Get, clone, export, rebind reports |
| Dashboards | /dashboards |
Get dashboards and tiles |
| Groups (Workspaces) | /groups |
Workspace CRUD, membership |
| Imports | /imports |
Upload PBIX/XLSX files |
| Pipelines | /pipelines |
Deployment pipeline automation |
| Admin | /admin |
Tenant-wide operations (scanner, activity) |
| EmbedToken | /GenerateToken |
Create embed tokens |
| Gateways | /gateways |
Gateway and data source management |
| Dataflows | /dataflows |
Dataflow management |
| Apps | /apps |
App management |
| Capacities | /capacities |
Capacity management |
| Goals | /goals |
Scorecards and goals |
Common API Operations
Refresh a Semantic Model
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes
Authorization: Bearer {token}
Content-Type: application/json
{
"notifyOption": "MailOnFailure",
"retryCount": 2,
"type": "Full",
"commitMode": "transactional",
"applyRefreshPolicy": true
}
Enhanced refresh (selective tables/partitions):
{
"type": "Full",
"commitMode": "transactional",
"objects": [
{ "table": "Sales", "partition": "Sales_Current" },
{ "table": "Products" }
]
}
Get Refresh History
GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes?$top=10
Import a PBIX File
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/imports?datasetDisplayName=SalesReport&nameConflict=CreateOrOverwrite
Authorization: Bearer {token}
Content-Type: multipart/form-data
[PBIX file as form data]
Python:
import requests
url = f"https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/imports"
params = {"datasetDisplayName": "SalesReport", "nameConflict": "CreateOrOverwrite"}
headers = {"Authorization": f"Bearer {token}"}
with open("SalesReport.pbix", "rb") as f:
response = requests.post(url, params=params, headers=headers,
files={"file": ("SalesReport.pbix", f, "application/octet-stream")})
Export Report to File
# Initiate export
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/ExportTo
{
"format": "PDF",
"powerBIReportConfiguration": {
"pages": [
{ "pageName": "ReportSection1" }
],
"defaultBookmark": { "name": "BookmarkName" }
}
}
# Poll for completion
GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/exports/{exportId}
# Download when status is "Succeeded"
GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/exports/{exportId}/file
Supported formats: PDF, PPTX, PNG, XLSX, CSV, XML, MHTML, IMAGE, ACCESSIBLEPDF
Update Dataset Parameters
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/Default.UpdateParameters
{
"updateDetails": [
{ "name": "ServerName", "newValue": "prod-server.database.windows.net" },
{ "name": "DatabaseName", "newValue": "ProdDB" }
]
}
Take Over a Dataset
POST https://api.powerbi.com/v1.0/myorg/groups/{worksp
Установить rest-api-automation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rest-api-automation?
Power BI REST API and Fabric REST API automation. PROACTIVELY activate for: (1) calling Power BI REST APIs, (2) embed-token generation (App Owns Data, User Owns Data), (3) service-principal authentication for Power BI, (4) dataset refresh API and refresh status polling, (5) push datasets and streaming, (6) Admin API (workspace/dataset enumeration), (7) Power BI Embedded and the JavaScript SDK (powerbi-client), (8) export-to-file API (PDF/PPTX/PNG), (9) Power BI automation via PowerShell (MicrosoftPowerBIMgmt), (10) Scanner API for tenant inventory, (11) app registration in Microsoft Entra ID. Provides: REST endpoint reference, OAuth/MSAL token recipes, embed-token patterns, refresh automation scripts, JavaScript SDK examples, and PowerShell module recipes.
Как установить скилл rest-api-automation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rest-api-automation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic