Skip to main content

Hi there,

 

I have a question  -  as a last resort.

I am trying to build a proof of concept for mapping our data center with Lucid diagrams. Our corporation already uses these diagrams, they are done manually and they are always behind. We’d like to have them updated dynamically.

I played with Lucidchart API in Postman, just to see how versatile and quick such endeavor would be. I was able to create and get a document but not more than that.

I spent multiple hours in the docs today but I was not able to put a single square on an empty diagram, via a post/patch request. I could not find any examples that were helpful to my case.

Is there a direct way to handle these requests without working with an SDK / front-end? Would like to stick to Python. The final goal is to have data flowing in a CI/CD pipeline and update our diagrams automatically. First… i need to put a least a box in a document.

 

Please let me know if my approach is futile.

Thanks

 

I found this post. 

It seems there are no endpoints available for adding shapes and lines to an already created document. There isn’t a REST API for that.

Is this still the case?

Furthermore, if shapes can be added with the document creation request, what is the JSON format expected? (Besides “title” and “product” fields)

 

Thanks,

D.


Hi @diozsa , this sounds like a great use case for dynamically updating diagrams, though, it is still the case that our Standard Import cannot be used to update existing documents.

 

Our JSON import supports programmatically creating new documents from JSON files that fit the format described in our Standard Import Documentation. Here’s an example from our sample-lucid-rest-applications GitHub repo for reference: sample-lucid-rest-applications/standard-import/demo-files/demo/.

 

If you haven’t already considered, here are some in-product (not API) solutions that you may find helpful.

  1. Lucidscale connects directly to your cloud provider and automatically builds infrastructure models. These models can be refreshed and updated from the Data Hub. However, please note that Lucidscale is not currently supported with Lucid’s API. Learn more here: Welcome to Lucidscale.

  2. You might also explore linking a dataset to a Lucidchart document. This will ensure the dataset remains current through live syncing, and the linked shapes on the canvas will reflect the latest data. While this won't automatically add shapes, it could be a step toward the solution you’re seeking. Here’s our data linking article from the Lucid Help Center.

 

 


I went through the process of OAth client creation, then I tried getting an Oauth2 token in Postman using client ID / secret and the Test Redirect URI, but I keep getting a 404 - “Could not complete OAuth 2.0 token request” message. Tried it with CURL too.

POST request fails - following the example in Standard Import Docs (for pushing a new document with content)

My intention is to send JSON that includes shapes within the request for doc creation (or to an already created document), skipping the whole front end. Can I send a zipped JSON directly (with the required format) so that way I could avoid developing a JS webapp?


Hi @diozsa , a common pitfall with OAuth2 client creation is missing the authorization URL step where you obtain the access token. To confirm, have you registered your redirect URI in your OAuth2 application in your Lucid Developer Portal then included this exact same redirect URI in your authorization URL? Authenticating to your Lucid account after accessing this Auth URL will return a short-lived access token that serves as the 'code' parameter for your Create Access Token POST request.

 

Once you’ve generated an OAuth2 token with the necessary scopes (e.g. lucidchart.document.content), you can follow our Standard Import instructions for our Import Document endpoint to send a .lucid zip file to create a new document from a correctly formatted JSON

 

I hope this is helpful! Please let us know if you have any specific questions along the way.


@Richard U  - Thanks for the clear info. I was able to push a  new doc with a square in it :)

 

It is a cumbersome process overall - versus what I experienced initially when I tested the first get/post request for a blank doc. I was expecting to be able to pick those icons/shapes by ID and push them with their associated links/lines - like building a graph. For now, this type of approach would take too long with Lucid - I will stick to links and nodes in Python.


Awesome to hear you got that working! Thanks a lot for your feedback on the process. I’ve passed it along to our Product team as we’re always looking to improve our Developer Platform and Standard Import API.

If you run into any more questions or need help down the road, just let me know!


Hey Richard,

I have received an invite for a demo for our organization, towards finding a solution to generate dynamic network diagrams. I think the email got cleaned up by our security, because I can’t find it anywhere.

Is there a way to get it resent to me so I can forward it to my team lead?

 

Thanks!


Hi @diozsa , we’re happy to help track this down. I’ve opened a support ticket on your behalf to get this going.


Reply