Ich möchte lokale Pbix-Datei in den Arbeitsbereich in azure Power BI-Konto zu importieren. Ich habe bereits workspaceId mit der REST API erstellt. Jedoch, wenn ich versuche, pbix-Datei zu importieren, die 200 OK-Status anstelle von 202 gibt akzeptierte Antwort mit ID.Importieren Sie .pbix (power BI) -Datei in den Arbeitsbereich mit PHP (mehrteilige Form-Daten Post)
Hier ist der Referenzcode i enter link description here gefolgt
POST https://api.powerbi.com/v1.0/collections/mypbiapp/workspaces/32960a09-6366-4208-a8bb-9e0678cdbb9d/imports?datasetDisplayName=mydataset01 Berechtigung: AppKey MpaUgrTv5e ... Content-Type: multipart/form-data; boundary = "A300testx"
--A300testx Content-Disposition: form-data
{der Inhalt (binär) .pbix Datei} --A300testx--
ich php verwendet curl Anfrage genannt REST-API und zeigt den Code, die ich versuchte,
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.powerbi.com/v1.0/collections/XXXXXX/workspaces/XXX-XXX-XXX-XXXXXXXX/imports?datasetDisplayName=mydataset01');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postData = array(
'datafile' => '@C:\Users\Desktop\report1.pbix',
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt ($ch, CURLOPT_HTTPHEADER, array (
"Authorization: AppKey R97v4Fe5=="
));
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
echo $response = curl_exec($ch);
curl_close ($ch);
als Antwort ich bin Statuscode 200 ok mit json bekommen
{ "id": "0331a80d-6f23-4626-9624-1f6b98ce373a"}
jedoch diese neue Datensatz wurde nicht in workspaceID erstellt. Bitte helfen Sie mir, das Problem hier zu finden.