Forum Discussion
Create a report from an existing one with PBIRS API
I'm pretty sure you would need to base64 encode this content in order to include it in the json body
Yes, that's exactly what the POST body documentation of the content parameter says:
| string A string value that contains binary encoding by base64url encoding rules. The value of this property is not processed by the server. In object creation the server receives and stores a value, and in object retrieval the server returns the previously stored value. |
For this reason I simply base64 encoded the content of a pbix file but without success.
- d_gosbell3 years ago
Super User
Anonymous wrote:
For this reason I simply base64 encoded the content of a pbix file but without success.
This is not what you said in your initial post where you get the response from /PowerBIReports({Id})/Content/$value. You said:
Anonymous wrote:
if I try to put the same exact content in the POST /PowerBIReports I obtain errors on the json
So are you actually doing the base64 encoding yourself? Because I do not believe the return value from /PowerBIReports({Id})/Content/$value is base64 encoded, it appears to be raw binary.
If you are doing the base64 encoding yourself then you must be missing a comma somewhere else in the post body as the error message says.
- Anonymous3 years agoNot applicable
Sorry for not being clear: I've done a lot of testing(json, base64, ....)
We have solved encoding the pbix file in base64 not from command line but with a nodejs application. No idea why the base64 command from CLI did not worked.