Server-side example for creating and/or updating an existing diagram using the Java API and the data-driven plugin (via p=update).
See https://github.com/jgraph/drawio-data-driven/blob/master/src/com/mxgraph/examples/DataServlet.java#L29 for documentation.
A general demo of the data-driven plugin is available here. (The updateUrl and updateInterval are embedded in the metadata of the diagram encoded in the #R part in this example.)