Component last updated time using /v1/files/:key

Hi,

Is it possible to get the last updated time for a component or component set using the /v1/files/:key endpoint? It looks like the data is available using /v1/files/:file_key/component_sets or /v1/files/:file_key/component, but the /v1/files/:key endpoint is much faster and flexible for my use case and so I would prefer to only use that. If this isn’t possible, is it something that may be added in the future? Thank you!

1 Like

I’m also struggling with it.

I am trying to collect statistics on the usage of components in a file. I need to check that the file is using the latest versions of components from the library. At the moment I need to make several requests in sequence:

  1. GET /v1/files/:key from here to get the key and structure of the component
  2. GET/v1/components/:key from here to get the node_id in the library file
  3. GET /v1/files/:key/nodes?ids=node_id to get the component structure.

And then I have to make several dozen more requests trying to match ids inside the component structure to make the comparison succeed. And it doesn’t always work.
Why is it so difficult? because I have no information about when the component in the file was updated and I have to compare the node structure.

It would be great if in a GET /v1/files/:key request I could see the last update date or library version number of the component in the file:

   "295:312": {
      "key": "2b27...",
      "name": "state=default, paddings=true",
      { "description": "",
      "remote": true,
      "componentSetId": "295:311",
      "updated_at": "2023-02-27T15:04:27.596Z",
      "library_version": "454756344",
      "documentationLinks": []
    }

Then I could compare with the same fields in the file and in the library.

Yes, I can track component modifications via webhooks and library publishing events, but unfortunately I can’t get historical data and work with old files.