Skip to main content
Solved

Creating document with API in Lucidchart

  • 15 March 2023
  • 6 replies
  • 542 views

is there a good example of creating shapes and lines using API ?



I am trying to create a diagram via code I am able to create a blank document and view the content of already created diagram via  https://api.lucid.co/documents/:id/contents   

Comments

Userlevel 3
Badge +4

Hi! Thanks for reaching out.

We recently released the documentation for our Extension API which allows developers to build extensions (like a plug-in) to Lucidchart and Lucidspark. The Extension API has functionality which allows you to write and read document contents.

For an extension to execute the Lucidchart document or Lucidspark board must be open. For these reason the Extension API is not an ideal solution for every use case. We unfortunately do not currently offer a REST API endpoint that allows you create a document with shapes and lines already added. Another potential (though likely not ideal) option would be to send bootstrap data when using the Create Document REST API endpoint and build an extension which receives the data and populates the canvas with the shapes/lines. However this still has the limitation that the document must be opened by a user in order for the extension to run.

Please let us know if you have any additional questions. Thanks for your question!

Thanks for your response.  Keeping the document open would not be possible for my use case. 

Problem is manually created diagrams get outdated very quickly.  I want to create diagrams automatically based on various data sources and keep them up to date with no user interaction. As we already have Lucid license wanted to see if I can use it instead of exploring other options.

Userlevel 4
Badge +7

Thank you for getting back to us and providing more context around your use case. Unfortunately what you are trying to do with our APIs is not currently supported. However we're always looking for ways to improve our public APIs and your feedback is the best way for us to do that. Would you mind adding your idea to our Product Feedback section? Ideas submitted to this section are passed on to the product development team for their consideration.

Thanks for your request and I apologize for any inconvenience this causes you.

I have submitted the feedback form.

Userlevel 3
Badge +4

Just an FYI for those who're interested: we are currently building this endpoint!

You're welcome to leave feedback on our design or follow updates on this thread.

Userlevel 3
Badge +4

I wanted to pass along that we released our production version of this endpoint! 

 

We're calling it our Lucid Standard Import. To use it, you'd pass a .lucid file (format described here) into our Import Document API. Please feel free to post any follow up questions in this forum.

 

Note this REST API endpoint allows for an app/script to create a document with shapes/lines/etc. populated. We currently don’t have a REST API endpoint to update shapes/lines/etc. already on the canvas. This is something we intend to explore in 2024.

Reply