Skip to main content

Save draft slides

POST https://api.rollstack.com/public/v1/reports/{id}/slides

Writes slides you wrote as HTML into a slide deck, as the slides agent's are: a draft sent under the id of a slide of the report replaces that slide where it is, any other is added right after the slide named in afterSlideId, or at the end without one, and every other slide stays. To move, remove or hide slides, use arrangeReportSlides. Render them with renderReportSlides first: nothing is saved while a draft still has an issue, and the issues come back instead. A chart or table a draft places is filled with its datasheet's data as part of the save, with no change to the slides. Take the save back by restoring versionBeforeId with restoreReportVersion. Only the report's editors may. At most 10 drafts a call, and 20 renders and saves a minute per user.

Requires the slide_decks:write scope.

Operation ID: saveReportSlides.

Path parameters

  • id (string, required): The report to act on, by its id from listReports or createReport. Only reports whose type is SlideDeck work here: another type, such as a Google Slides presentation, returns 400. You can also copy it from the report's link in Rollstack: it's the part right after /slides/.

Headers

  • Idempotency-Key (string): A unique value, such as a UUID, that makes retrying this call safe. A retry with the same key within 24 hours answers the first call's result instead of running it again. Use a new key for each new call. From 1 to 255 printable ASCII characters.

Request body, required

application/json

  • slides (array of object, required): The draft slides to save, 1 to 10 a call, each under an id of its own.
    • id (string, required): The id you give the slide: letters, digits, _ and -, at most 64 characters. Pass an existing slide's id to redraw that slide.
    • html (string, required): The slide as one <section> of HTML, as large as the report's canvas. No scripts, embedded pages, event attributes or anything loaded from outside it.
  • afterSlideId (string): The slide of the report the new slides go right after, by its id from getReportContent. Without it they are added at the end. A draft sent under the id of a slide of the report replaces that slide where it is.

Response 200

Success

application/json

  • saved (boolean, required): Whether the drafts were written into the report. False while any of them still has an issue: nothing is written then.
  • versionBeforeId (string): The version of the report saved before this change. Restore it with restoreReportVersion to take the change back.
  • conversionError (string): Why the drafts could not be turned into slides, when one could not. Fix it and save again.
  • slides (array of object, required): The drafts, in the order they were sent.
    • id (string, required): The draft, by the id it was sent with.
    • slideId (string or null, required): The slide of the report the draft became: a new id for a new slide, the same id for a slide it replaced. Send a later draft under this id to change the slide. Null when nothing was saved.
    • issues (array of string, required): What to fix before the draft can be saved.
    • notes (array of string, required): What to check by eye. These block nothing.
  • datasheets (array of object, required): The datasheets whose charts and tables the save placed. Their data is read as part of the save, so the slides show it at once, unless the source is slow: then the save answers first and the data follows.
    • id (string, required): The datasheet.
    • error (string or null, required): Why its data is not on the slide: the read failed, or it is still running and the slide shows the data once it ends. Null when the data was read.