Forum Discussion
Oauth 2.0: Session API Token Request Fails with Special Chrs in Body?!? (Rest API)
- Anonymous6 years ago
artemus , thank you for all of your help troubleshooting this issue!!! It's insanely valuable and been absolutely appreciated. I wanted to let you (as well as others that see this thread) know that we were able to resolve the issue. I contacted the vendor after our multiple attempts and it was determined the API had a bug. Your code was 100% correct and works flawlessly!
Thank you again!
-Brett
See the sample here: https://github.com/microsoft/DataConnectors/blob/dbd99078501897e04e7a6b9305ad7857ae1b7a63/samples/Github/github.pq
To develop/use:
1. Optional: Install Visual studio and get the power bi extension.
2. Write code
3. In visual studio: build code, find the .mez file in your project's bin folder
or
3. Create a zip file of your .pq file and rename it to .mez
4. Copy file to :<home directory>\Power BI Desktop\Custom Connectors\
5. In Power bi go to options -> security and enable loading of custom connectors.
6. Connector should appear when you choose GetData
Note if you modify the .mez file you will need to do a refresh preview to see the changes.
So... I'm guessing, but would that connector would mean the report has to reside on the desktop at all times?!? While I have Power BI Desktop, we need the reports to run in the cloud on Teams and such.
The code looks nearly identical to what we have already written...
Are we able to rule out it isn't the special characters, compression, or encoding causing the trouble?
- artemus6 years ago
Microsoft Employee
I think the main difference is the headers passed in. I.e. it says use Json
As far as I mentioned, if you use a custom connector and you want it to refresh itself, you would need to set up an enterprise gateway which would let you install the custom connector on it.
- Anonymous6 years agoNot applicable
Where do you see it saying "use Json"? In the code you linked or elsewhere? I could give that a try...
- artemus6 years ago
Microsoft Employee
It is here (line 154): https://github.com/microsoft/DataConnectors/blob/dbd99078501897e04e7a6b9305ad7857ae1b7a63/samples/Github/github.pq#L154
The request headers are different in this example