Datasets - Get Datasources
Returns a list of data sources for the specified dataset from My workspace.
Required Scope
Dataset.ReadWrite.All or Dataset.Read.All
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
		URI Parameters
| Name | In | Required | Type | Description | 
|---|---|---|---|---|
| 
						 dataset 
					 | 
					path | True | 
			 string  | 
					
						 The dataset ID  | 
				
Responses
| Name | Type | Description | 
|---|---|---|
| 200 OK | 
		 OK  | 
Examples
Analysis Services example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "AnalysisServices",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}
				Azure Blobs datasource example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "value": [
    {
      "datasourceType": "AzureBlobs",
      "datasourceId": "e0315274-90b6-4fc0-abf2-2d60d448cb04",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "account": "myAccount",
        "___domain": "blob.core.windows.net"
      }
    }
  ]
}
				Excel example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "File",
      "connectionDetails": {
        "path": "c:\\users\\username\\documents\\orders1.xlsx"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}
				Extension datasource example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "value": [
    {
      "datasourceType": "Extension",
      "datasourceId": "70540d95-4c8e-41ae-88c6-27a103b12841",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "kind": "AzureDataExplorer",
        "path": "https://myserver.kusto.windows.net"
      }
    }
  ]
}
				Microsoft Exchange datasource example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "value": [
    {
      "datasourceType": "Exchange",
      "datasourceId": "4d126fc8-1568-46aa-ba16-ccf19b18f012",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "emailAddress": "john@contoso.com"
      }
    }
  ]
}
				OData example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "OData",
      "connectionDetails": {
        "url": "http://services.odata.org/MyOdata/MyOdata.svc"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}
				Oracle example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "Oracle",
      "connectionDetails": {
        "server": "My-Oracle-Server",
        "database": "My-Oracle-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}
				Salesforce datasource example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "value": [
    {
      "datasourceType": "Salesforce",
      "datasourceId": "e8a6e0f5-b244-402a-ba5a-4d578609ede3",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "classInfo": "report-detail",
        "loginServer": "https://login.salesforce.com/"
      }
    }
  ]
}
				SAP HANA example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "SAPHana",
      "connectionDetails": {
        "server": "My-SapHana-Server",
        "database": "My-SapHana-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}
				SharePoint example 
			Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "SharePointList",
      "connectionDetails": {
        "url": "https://microsoft.sharepoint.com/hello/myproj/"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}
				SQL example
Sample request
GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources
			Sample response
{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "Sql",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}
				Definitions
| Name | Description | 
|---|---|
| Datasource | 
							 A Power BI data source  | 
					
| 
							Datasource | 
						
							 The Power BI data source connection details. See examples in Get Datasources or Get Datasources In Group.  | 
					
| Datasources | 
							 The OData response wrapper for a Power BI data source collection  | 
					
Datasource
A Power BI data source
| Name | Type | Description | 
|---|---|---|
| connectionDetails | 
		 The data source connection details  | 
|
| connectionString | 
			 string  | 
	
		 (Deprecated) The data source connection string. Available only for DirectQuery.  | 
| datasourceId | 
			 string (uuid)  | 
	
		 The bound data source ID, which is empty when not bound to a gateway  | 
| datasourceType | 
			 string  | 
	
		 The data source type  | 
| gatewayId | 
			 string (uuid)  | 
	
		 The bound gateway ID, which is empty when not bound to a gateway. When using a gateway cluster, the gateway ID refers to the primary (first) gateway in the cluster and is similar to the gateway cluster ID.  | 
| name | 
			 string  | 
	
		 (Deprecated) The data source name. Available only for DirectQuery.  | 
DatasourceConnectionDetails  
			
			The Power BI data source connection details. See examples in Get Datasources or Get Datasources In Group.
| Name | Type | Description | 
|---|---|---|
| account | 
			 string  | 
	
		 The connection account  | 
| classInfo | 
			 string  | 
	
		 The connection class information  | 
| database | 
			 string  | 
	
		 The connection database  | 
| ___domain | 
			 string  | 
	
		 The connection ___domain  | 
| emailAddress | 
			 string  | 
	
		 The connection email address  | 
| kind | 
			 string  | 
	
		 The connection kind  | 
| loginServer | 
			 string  | 
	
		 The connection login server  | 
| path | 
			 string  | 
	
		 The connection path  | 
| server | 
			 string  | 
	
		 The connection server  | 
| url | 
			 string  | 
	
		 The connection URL  | 
Datasources
The OData response wrapper for a Power BI data source collection
| Name | Type | Description | 
|---|---|---|
| @odata.context | 
			 string  | 
	
		 OData context  | 
| value | 
		 The data source collection  |