Skip to main content
Solved

No ContainedBy in JSON export?

  • 24 June 2024
  • 4 replies
  • 26 views

I’m trying to use the Document Contents API endpoint to retrieve the diagram data.   I’ve noticed however that there is no “ContainedBy” data available.  This is present in the CSV export.  I have custom data fields bound to the container and would like to be able to parse the JSON in such a way to extract the both the custom data and the child elements of the container.

 

Thank you,

Richard

Comments

Userlevel 4
Badge +7

Hi Richard, thanks for posting! I saw you replied to another thread with this question and I responded to you there. Re-posting my response below for extra visibility.

 

Unfortunately the ContainedBy field you see in the CSV export currently isn’t included by default in the JSON response to a GET Document Contents, so there is no way to tell which shapes are in containers.

However, one way you could work around this is by using the CONTAINED or CONTAINEDBY formula functions in your document. This would allow you to identify which shapes are in which containers from the "customData" part of the JSON response. You can find an example in this Developer Community post, where another user is seeking help with the exact CONTAINED function to use.  

Please feel free to respond with your feedback or a brief description of your use case, especially if this workaround isn’t suitable. We are always looking for ways to improve our public API’s and we value your feedback. 

Badge +1

Thank you, I’ll have a look at that option.  I would happily use a CSV export too if there were a way to download that via API.  I had hoped changing the accepted format to text/csv would have worked.

Badge +1

Thank you, I’ll have a look at that option.  I would happily use a CSV export too if there were a way to download that via API.  I had hoped changing the accepted format to text/csv would have worked.

I have the same issue and would also happy if CSV export over REST API is possible or even better, if the contained by info is included in the JSON reply. 

Userlevel 2
Badge +2

Hello ralfpanse,

I apologize for the very delayed response. I had taken note of this request for internal discussion but failed to respond.

As mentioned, we don’t currently offer an API based `CSV export`, nor `containedBy` within JSON. However, I have passed these requests on for internal consideration. For clarity, these changes would not be available soon, but the feedback is helpful in us understanding what improvements would have the most value.

Reply