Using the REST API
Our sample projects and report templates can help you learn the basics of working with our products.The Stimulsoft Server REST API can log in, create a report snapshot, run a template into it, and export the snapshot to PDF.
Log in, snapshot, run, export.
How it works. The REST workflow chains login → run → export through session-keyed calls, so any HTTP client can generate documents from the Server.
Log in, snapshot, run, export.
// Log in
var login = WebRequest.Create("http://localhost:40010/1/login");
login.Headers.Add("x-sti-UserName", Username);
login.Headers.Add("x-sti-Password", Password);
var sessionKey = (string)GetJson(login)["ResultSessionKey"];
// Create a snapshot, then run the template into it
var run = WebRequest.Create("http://localhost:40010/1/reporttemplates/" + reportKey + "/run");
run.Method = "PUT";
run.Headers.Add("x-sti-SessionKey", sessionKey);
run.Headers.Add("x-sti-DestinationItemKey", snapshotKey);
// Export the snapshot to PDF
var export = WebRequest.Create("http://localhost:40010/1/reportsnapshots/" + snapshotKey + "/export");
export.Method = "PUT";
export.Headers.Add("x-sti-SessionKey", sessionKey);
Request(export, "{ 'ExportSet': { 'Ident':'Pdf', 'EmbeddedFonts':false } }");/login→ResultSessionKey— every later request carries it as thex-sti-SessionKeyheader./reporttemplates/{key}/run— render the template into a snapshot;/reportsnapshots/{key}/exportexports it to PDF.
How it works. The REST workflow chains login → run → export through session-keyed calls, so any HTTP client can generate documents from the Server.