Access to InlineCollaborativeObject, InlineStructuredValue, Embed, etc with the api


I plan to work on a pack with additional functions for the canvas column type, for exemple :
get all the embed from a canvas
get all the file
get all the image

First of all, i try to make it with the formula. Here is the doc with some experiments :

And i notice i get no information about some of some node of the canvas. So i check with the API but i didn’t really get more information.
When we use a file column or a image column, it is possible to get more information like the hosted url of a file.

In both case, i get the id of the node : ec-xxxxxx, esv-xxxxxx, etc.

Is there a way to use the api to access diretly the informations of these node?

Thank you in advance for the help.

Hi @j.b_o - Neither the Packs SDK nor the Coda API currently contain the ability to retrieve canvas content (be it on a page or in a canvas column) with full fidelity. The closest representation you can get is by passing the content to a Pack parameter of type Html. This will give you an HTML export of the content, which does have some information about the URL of images, etc.

<div style="text-align: left; margin-top: 0.5em; margin-bottom: 0.5em;">
  <span style="display: inline-block;">
    <img data-coda-env="prod" data-coda-doc-id="ZmJ5JDLLbE" data-coda-blob-id="bl-WXNzJaekJu" 
        data-coda-mime-type="image/png" data-coda-size="1562431" alt="test.png" 
        height="1024" width="1024">

This technique is mentioned in the Pack SDK documentation, with the following important caveat:

The generated HTML for a given value is not a stable API surface that you should rely on. We may change it at any time without warning, so we don’t recommend that you parse it to extract information. Use it for display purposes only.

Thank you @Eric_Koleda for the quick answer.
It is a cleaver approach. I have in mind the warning.
The canvas field is a very powerful function. It could be interesting to access to the content. I will think about it twice before starting with a new pack project.