Python (SDK)
import os
from textql_sdk import Textql
from textql_sdk.utils import parse_datetime
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.powerbi.sync_power_bi_items(reports=[
{
"created_date": parse_datetime("2023-01-15T01:30:15.01Z"),
},
], datasets=[
{
"created_date": parse_datetime("2023-01-15T01:30:15.01Z"),
},
])
# Handle response
print(res)import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.powerbi.syncPowerBIItems({
body: {
reports: [
{
createdDate: new Date("2023-01-15T01:30:15.01Z"),
},
],
datasets: [
{
createdDate: new Date("2023-01-15T01:30:15.01Z"),
},
],
},
});
console.log(result);
}
run();curl --request POST \
--url https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '
{
"connectorId": 123,
"workspaceId": "<string>",
"workspaceName": "<string>",
"reports": [
{
"id": "<string>",
"name": "<string>",
"webUrl": "<string>",
"embedUrl": "<string>",
"datasetId": "<string>",
"createdBy": "<string>",
"createdDate": "2023-11-07T05:31:56Z"
}
],
"datasets": [
{
"id": "<string>",
"name": "<string>",
"addRowsApiEnabled": true,
"configuredBy": "<string>",
"isRefreshable": true,
"isEffectiveIdentityRequired": true,
"isEffectiveIdentityRolesRequired": true,
"isOnPremGatewayRequired": true,
"createdDate": "2023-11-07T05:31:56Z",
"tableNames": [
"<string>"
]
}
]
}
'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
connectorId: 123,
workspaceId: '<string>',
workspaceName: '<string>',
reports: [
{
id: '<string>',
name: '<string>',
webUrl: '<string>',
embedUrl: '<string>',
datasetId: '<string>',
createdBy: '<string>',
createdDate: '2023-11-07T05:31:56Z'
}
],
datasets: [
{
id: '<string>',
name: '<string>',
addRowsApiEnabled: true,
configuredBy: '<string>',
isRefreshable: true,
isEffectiveIdentityRequired: true,
isEffectiveIdentityRolesRequired: true,
isOnPremGatewayRequired: true,
createdDate: '2023-11-07T05:31:56Z',
tableNames: ['<string>']
}
]
})
};
fetch('https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connectorId' => 123,
'workspaceId' => '<string>',
'workspaceName' => '<string>',
'reports' => [
[
'id' => '<string>',
'name' => '<string>',
'webUrl' => '<string>',
'embedUrl' => '<string>',
'datasetId' => '<string>',
'createdBy' => '<string>',
'createdDate' => '2023-11-07T05:31:56Z'
]
],
'datasets' => [
[
'id' => '<string>',
'name' => '<string>',
'addRowsApiEnabled' => true,
'configuredBy' => '<string>',
'isRefreshable' => true,
'isEffectiveIdentityRequired' => true,
'isEffectiveIdentityRolesRequired' => true,
'isOnPremGatewayRequired' => true,
'createdDate' => '2023-11-07T05:31:56Z',
'tableNames' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems"
payload := strings.NewReader("{\n \"connectorId\": 123,\n \"workspaceId\": \"<string>\",\n \"workspaceName\": \"<string>\",\n \"reports\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"webUrl\": \"<string>\",\n \"embedUrl\": \"<string>\",\n \"datasetId\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"datasets\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"addRowsApiEnabled\": true,\n \"configuredBy\": \"<string>\",\n \"isRefreshable\": true,\n \"isEffectiveIdentityRequired\": true,\n \"isEffectiveIdentityRolesRequired\": true,\n \"isOnPremGatewayRequired\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"tableNames\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connectorId\": 123,\n \"workspaceId\": \"<string>\",\n \"workspaceName\": \"<string>\",\n \"reports\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"webUrl\": \"<string>\",\n \"embedUrl\": \"<string>\",\n \"datasetId\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"datasets\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"addRowsApiEnabled\": true,\n \"configuredBy\": \"<string>\",\n \"isRefreshable\": true,\n \"isEffectiveIdentityRequired\": true,\n \"isEffectiveIdentityRolesRequired\": true,\n \"isOnPremGatewayRequired\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"tableNames\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connectorId\": 123,\n \"workspaceId\": \"<string>\",\n \"workspaceName\": \"<string>\",\n \"reports\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"webUrl\": \"<string>\",\n \"embedUrl\": \"<string>\",\n \"datasetId\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"datasets\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"addRowsApiEnabled\": true,\n \"configuredBy\": \"<string>\",\n \"isRefreshable\": true,\n \"isEffectiveIdentityRequired\": true,\n \"isEffectiveIdentityRolesRequired\": true,\n \"isOnPremGatewayRequired\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"tableNames\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"error": "<string>",
"syncedReportIds": [
"<string>"
],
"syncedDatasetIds": [
"<string>"
]
}{
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}Power BI Service
Sync Power BI Items
POST
/
textql.rpc.public.powerbi.PowerBIService
/
SyncPowerBIItems
Python (SDK)
import os
from textql_sdk import Textql
from textql_sdk.utils import parse_datetime
with Textql(
api_key=os.getenv("TEXTQL_API_KEY", ""),
) as textql:
res = textql.powerbi.sync_power_bi_items(reports=[
{
"created_date": parse_datetime("2023-01-15T01:30:15.01Z"),
},
], datasets=[
{
"created_date": parse_datetime("2023-01-15T01:30:15.01Z"),
},
])
# Handle response
print(res)import { Textql } from "@textql/sdk";
const textql = new Textql({
apiKey: process.env["TEXTQL_API_KEY"] ?? "",
});
async function run() {
const result = await textql.powerbi.syncPowerBIItems({
body: {
reports: [
{
createdDate: new Date("2023-01-15T01:30:15.01Z"),
},
],
datasets: [
{
createdDate: new Date("2023-01-15T01:30:15.01Z"),
},
],
},
});
console.log(result);
}
run();curl --request POST \
--url https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--header 'tql_api_key: <api-key>' \
--data '
{
"connectorId": 123,
"workspaceId": "<string>",
"workspaceName": "<string>",
"reports": [
{
"id": "<string>",
"name": "<string>",
"webUrl": "<string>",
"embedUrl": "<string>",
"datasetId": "<string>",
"createdBy": "<string>",
"createdDate": "2023-11-07T05:31:56Z"
}
],
"datasets": [
{
"id": "<string>",
"name": "<string>",
"addRowsApiEnabled": true,
"configuredBy": "<string>",
"isRefreshable": true,
"isEffectiveIdentityRequired": true,
"isEffectiveIdentityRolesRequired": true,
"isOnPremGatewayRequired": true,
"createdDate": "2023-11-07T05:31:56Z",
"tableNames": [
"<string>"
]
}
]
}
'const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
tql_api_key: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
connectorId: 123,
workspaceId: '<string>',
workspaceName: '<string>',
reports: [
{
id: '<string>',
name: '<string>',
webUrl: '<string>',
embedUrl: '<string>',
datasetId: '<string>',
createdBy: '<string>',
createdDate: '2023-11-07T05:31:56Z'
}
],
datasets: [
{
id: '<string>',
name: '<string>',
addRowsApiEnabled: true,
configuredBy: '<string>',
isRefreshable: true,
isEffectiveIdentityRequired: true,
isEffectiveIdentityRolesRequired: true,
isOnPremGatewayRequired: true,
createdDate: '2023-11-07T05:31:56Z',
tableNames: ['<string>']
}
]
})
};
fetch('https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connectorId' => 123,
'workspaceId' => '<string>',
'workspaceName' => '<string>',
'reports' => [
[
'id' => '<string>',
'name' => '<string>',
'webUrl' => '<string>',
'embedUrl' => '<string>',
'datasetId' => '<string>',
'createdBy' => '<string>',
'createdDate' => '2023-11-07T05:31:56Z'
]
],
'datasets' => [
[
'id' => '<string>',
'name' => '<string>',
'addRowsApiEnabled' => true,
'configuredBy' => '<string>',
'isRefreshable' => true,
'isEffectiveIdentityRequired' => true,
'isEffectiveIdentityRolesRequired' => true,
'isOnPremGatewayRequired' => true,
'createdDate' => '2023-11-07T05:31:56Z',
'tableNames' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Connect-Protocol-Version: <connect-protocol-version>",
"Content-Type: application/json",
"tql_api_key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems"
payload := strings.NewReader("{\n \"connectorId\": 123,\n \"workspaceId\": \"<string>\",\n \"workspaceName\": \"<string>\",\n \"reports\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"webUrl\": \"<string>\",\n \"embedUrl\": \"<string>\",\n \"datasetId\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"datasets\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"addRowsApiEnabled\": true,\n \"configuredBy\": \"<string>\",\n \"isRefreshable\": true,\n \"isEffectiveIdentityRequired\": true,\n \"isEffectiveIdentityRolesRequired\": true,\n \"isOnPremGatewayRequired\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"tableNames\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
req.Header.Add("tql_api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("tql_api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connectorId\": 123,\n \"workspaceId\": \"<string>\",\n \"workspaceName\": \"<string>\",\n \"reports\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"webUrl\": \"<string>\",\n \"embedUrl\": \"<string>\",\n \"datasetId\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"datasets\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"addRowsApiEnabled\": true,\n \"configuredBy\": \"<string>\",\n \"isRefreshable\": true,\n \"isEffectiveIdentityRequired\": true,\n \"isEffectiveIdentityRolesRequired\": true,\n \"isOnPremGatewayRequired\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"tableNames\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.textql.com/textql.rpc.public.powerbi.PowerBIService/SyncPowerBIItems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["tql_api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connectorId\": 123,\n \"workspaceId\": \"<string>\",\n \"workspaceName\": \"<string>\",\n \"reports\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"webUrl\": \"<string>\",\n \"embedUrl\": \"<string>\",\n \"datasetId\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"createdDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"datasets\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"addRowsApiEnabled\": true,\n \"configuredBy\": \"<string>\",\n \"isRefreshable\": true,\n \"isEffectiveIdentityRequired\": true,\n \"isEffectiveIdentityRolesRequired\": true,\n \"isOnPremGatewayRequired\": true,\n \"createdDate\": \"2023-11-07T05:31:56Z\",\n \"tableNames\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"error": "<string>",
"syncedReportIds": [
"<string>"
],
"syncedDatasetIds": [
"<string>"
]
}{
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "<string>",
"debug": {}
}
]
}Authorizations
Headers
Define the version of the Connect protocol
Available options:
1 Define the timeout, in ms
Body
application/json
⌘I