Quantcast
Viewing all articles
Browse latest Browse all 17920

Unable to Clone or Copy the Power BI Report

Dear All,

 

I had written the below code to clone the Power BI report , But I don't find the luck to clone the report .

Can any one help me in knowing what's wrong in my below code.

 

Code:

 

 

function CopyReport(reportId, Name, Dataset) {
    debugger;
    var deferred = $.ajax({
        url: "https://api.powerbi.com/v1.0/myorg/reports/" + reportId + "/Clone",
        type: "POST",
        headers: {
            "Authorization": "Bearer " + accessToken
        },
       // ContentType: "application/json",
        data: { Name: Name},
        //data: { name: Name, targetWorkspaceId: Dataset },
        success: function (responseData) {
            cache.write(responseData, "Copy report")
        },
        error: function (responseData) {
            debugger;
            cache.write(responseData, "Copy report")
        }
    });
    return deferred.promise();
}

Error:

{"error":{"code":"PowerBINotAuthorizedException","pbi.error":{"code":"PowerBINotAuthorizedException","parameters":{},"details":[],"exceptionCulprit":1}}}

 


Viewing all articles
Browse latest Browse all 17920

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>