ReportMonitor - GetReportBytes

Hello,
I call Report Monitor rest api to GetReportBytes.
the code is working but,
when i read the returnobj and tried to convert to bytes and then from bytes convert to PDF file, i got problem. the pdf I generate has issue and can not open. i tried encoding.UTF8 and encoding.ASCII. all of them not working when i convert it to pdf.

any ideas?

thanks,

Eddy

var request = new RestRequest();
request.Method = Method.Post;
request.AddHeader(“Accept”, “application/json”);
request.AddJsonBody(input);
var response = client.Execute(request);
var content = response.Content;
JObject obj = JObject.Parse(content);
string report = (string)obj[“returnObj”];
return Encoding.Unicode.GetBytes(report);

I did Convert.FromBase64String(response[“returnObj”].Value());

1 Like

right. i tototally forgot. thanks so much