Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Request Body:
{
"datasourceType": "File",
"connectionDetails": "{\"path\":\"D:\\\\temp\\\\folderName\\\\dataFolder\\\\custPayData.xlsx\"}",
"datasourceName": "data_source_test_1_api",
"credentialDetails": {
"credentialType": "Windows",
"credentials":"{\"credentialData\":[{\"name\":\"username\", \"value\":\"DomainName\\UserName\"},{\"name\":\"password\", \"value\":\"password\"}]}",
"useEndUserOAuth2Credentials": false,
"encryptedConnection": "NotEncrypted",
"encryptionAlgorithm": "None",
"privacyLevel": "None"
}
}
Response :
{
"error": {
"code": "DMTS_InvalidEncryptionAlgorithmError",
"pbi.error": {
"code": "DMTS_InvalidEncryptionAlgorithmError",
"parameters": {},
"details": [],
"exceptionCulprit": 1
}
}
}
Headers:
Same issue here. Considering that this post is already half a year old, has anyone found a solution to this?
Found a solution to this.
You need to encrypt your credentials first, before you can make the API call. Encryption method in C# is described here: https://docs.microsoft.com/en-us/power-bi/developer/encrypt-credentials
encryptionAlgorithm should be set to "RSA-OAEP"
See my stackoverflow post here: https://stackoverflow.com/questions/56961746/power-bi-api-post-datasource-errors-with-dmts-invaliden...
I am going to try and build a JS / Node based encryption function and will post here when successful.
Do you have a update?
Joining in on the party. I have the same error when trying to add azure sql db's as datasources.
I can set the encryptionalgorithm to RSA-OAEP to avoid this error but then I get a
{'error': {'code': 'UnknownError', 'pbi.error': {'code': 'UnknownError'}}}
Possibly because for cloud datasources it needs to be set to none according to the docs. But maybe it can help you to set EncryptionAlgorithm to RSA-OAEP (only accepted value according to docs) and see what happens.
Hi ,
I am able to connect to odata source if it is of type "https" , but cannot connect to "http", I am getting same issue as above.
is "http" considered as on premise connection?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 8 | |
| 4 | |
| 3 | |
| 3 |