Forum Discussion
Anonymous
7 years agoNot applicable
Error while creating a new datasource on a gateway using REST API
Request Body: { "datasourceType": "File", "connectionDetails": "{\"path\":\"D:\\\\temp\\\\folderName\\\\dataFolder\\\\custPayData.xlsx\"}", "datasourceName": "data_source_test_1_api", "crede...
Anonymous
7 years agoNot applicable
Same issue here. Considering that this post is already half a year old, has anyone found a solution to this?
- Anonymous7 years agoNot applicable
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-invalidencryptionalgorithmerror/56961831#56961831
I am going to try and build a JS / Node based encryption function and will post here when successful.
- vpartem5 years agoFrequent Visitor
Do you have a update?