Get Import by File Path

 

Published: November 1, 2015

Updated: February 3, 2016


Request | Response | [Preview operation]

The Get Import by File Path operation returns a JSON body for an Import object with its properties including id, import source Reports, and Datasets. Include the Import file path in the filePath query string parameter in the GET uri to return an Import object.

Required scope: Metadata.View_Any

GET https://api.powerbi.com/beta/myorg/imports?filePath={filePath}

Query string parameter

NameDescription
filePathThe path to the import file.

Request examples

GET http://api.powerBI.com/beta/myorg/imports?filePath=http://microsoft-my.sharepoint.com/personal/{user name}/shared%20with%20everyone/mydoc.xlsx  

Header

Content-Type: application/json
Authorization: Bearer eyJ0eX ... FWSXfwtQ

Status code

CodeDescription
200OK. Indicates success. The response body contains a dataset if the file is imported, and a report if the file is connected.

Content-Type

application/json

Body schema

Imports have the following properties:

  • Id
  • Name
  • createdDateTime
  • Import source (either file or URL path)
  • Array of Reports
    • A Report has the same properties as returned by GET Reports.
  • Array of Datasets
    • A Dataset has the same properties as returned by GET Datasets.
{  
  "id" : "{import_guid}",  
  "createdDateTime" : "{DateTime}",  
  "updatedDateTime" : "{DateTime}",  
  "importState" : "{string}",  
  "error":  
    {  
        "code": "{string}",  
        "message": "{message}",  
        "target": "{target}",  
        "details": [  
            {  
            "code": "{code}",  
            "target": "{target}",  
            "message":  "{message}",  
            }  
        ]  
    },  
 "reports" : [  
      {  
          "id":"{guid}",  
          "name":"{string}"  
      }    
  ],          
  "datasets" : [  
      {  
          "id":"{guid}",  
          "name":"{import_name}"  
      }    
  ]  
}  

Body Example

{  
  "id" : "405BBEEB--30264301ED95",  
  "createdDateTime" : "2015-03-13 15:51:30.937",  
  "updatedDateTime" : "2015-03-13 15:51:30.937",  
  "importState" : "Published",   
  "error":  
    {  
        "code": "NotImplemented",  
        "message": "Requested feature is not implemented",  
        "target": "query",  
        "details": [  
            {  
            "code": "QueryParmNotSupported",  
            "target": "$search",  
            "message":  "Requested query option not supported",  
            }  
        ]  
    },  
 "reports" : [  
      {  
          "id":"A68F51BD--5EFF229013C7",  
          "name":"forecast.xlsx"  
      }    
  ],        
"datasets" : [  
      {  
          "id":"A68F51BD--5EFF229013C7",  
          "name":"forecast.xlsx"  
      }    
  ]  
}  

Show: