Programmatically create shapes and lines using REST API?
Hello Lucidchart Developer Community,
I'm currently exploring the functionalities of the Lucidchart API and I've hit a roadblock. My project requires dynamic creation and manipulation of diagram elements, specifically shapes and lines, and I'm curious about the extent of Lucidchart's API capabilities in this regard.
Does Lucidchart offer a REST API that allows for the programmatic creation of shapes and lines within a diagram? I'm interested in understanding how detailed this control is, such as specifying types, sizes, positions, and custom styling for these elements. Additionally, how feasible is it to dynamically add, modify, or interconnect these elements within a Lucidchart document via automated processes or external applications?
Any insights, documentation references, or examples of similar implementations would be greatly appreciated. Looking forward to your responses and guidance!
Best regards,
Nikolai
Page 1 / 1
Hi Nikolai!
In short, we do not have a REST API solution today for adding or manipulating (e.g. change their size, text, location, etc.) shapes or lines on the canvas. This is something we are actually hoping to begin building in the near future.
We recently released REST API functionality (adding the Lucid Standard Import type to our Import document endpoint) that allows you to define where shapes, lines, etc. will be on a document and then create a new document with the shapes, lines, etc. appropriately populated. However, this only works when the document is being created for the first time.
Our Extension API does have functionality for adding and manipulating shapes, lines, etc. on the canvas. However, the document does need to be open in the browser for the Extension API to run.
As we plan our functionality for editing shapes and lines, I am actually very curious about your use case. I’ll reach out via email to request a time to meet (if you’re comfortable).
Thanks!
Ian
As we plan our functionality for editing shapes and lines, I am actually very curious about your use case. I’ll reach out via email to request a time to meet (if you’re comfortable).
Ian
Please do!
We recently released REST API functionality (adding the Lucid Standard Import type to our Import document endpoint) that allows you to define where shapes, lines, etc. will be on a document and then create a new document with the shapes, lines, etc. appropriately populated. However, this only works when the document is being created for the first time.
I am trying to use the REST API - the barebones of it. So far testing in Postman.
For creating a document with the shapes and lines already added in, what is the object format accepted? A new doc requires “title” and “product” fields, and I think “shapes” have 3 required fields also.
Could you please post the JSON format for an initial document creation , that includes a simple shape in it?
Is the endpoint same as for new document?
Example - POST req for creating a doc - this creates a doc, but no shapes in it.