This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello,
I am currently trying to create an OData datasource via the Gateway - Create Data source API (Gateways - Create Datasource (Power BI Power BI REST APIs) | Microsoft Docs).
When I put in the JSON and execute, I am getting below error.
{
"error": {
"code": "BadRequest",
"message": "Bad Request",
"details": [
{
"message": "Unexpected character encountered while parsing value: {. Path 'connectionDetails', line 11, position 27.",
"target": "datasourceToGatewayRequest.connectionDetails"
},
{
"message": "'datasourceToGatewayRequest' is a required parameter",
"target": "datasourceToGatewayRequest"
}
]
}
}
The Input JSON looks as following:
{
"datasourceName": "My_ODATA",
"credentialDetails": {
"encryptedConnection": "Encrypted",
"credentialType": "Basic",
"credentials": "mSTkW...dEwQ==",
"privacyLevel": "Private",
"encryptionAlgorithm": "RSA-OAEP"
},
"dataSourceType": "OData",
"connectionDetails": {\"url\":\"https://myURL.com\"}
}
Whats wrong with that?
How can I create an OData data source via the API?
Thanks
Joerg
Solved! Go to Solution.
Thanks Xiaoxin,
I found the reason in the meantime. The parameter
"useEndUserOAuth2Credentials": false,
was missing. The error message was a little bit misleading.
Joerg
Thanks Xiaoxin,
I found the reason in the meantime. The parameter
"useEndUserOAuth2Credentials": false,
was missing. The error message was a little bit misleading.
Joerg
Hi @JoergSch,
If you not so sure these connection strings configured correctly.
You can try to directly config them on your gateway data source settings, then you can use the 'get Datasource' API to get the corresponding 'data source connections' as a referencce.
400 Bad Request - HTTP | MDN (mozilla.org)
Gateways - Create Datasource (Power BI Power BI REST APIs) | Microsoft Docs
Regards,
Xiaoxin Sheng
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 3 | |
| 3 | |
| 2 |