Fetch all versions
The app fetches all the versions of the file you opened.
Contents

Get a data ID handle
The app obtains a data ID handle for the versioned structured data (type tag 501) that contains the file you opened. The ID of this structured data is based on your user prefix and the name of the file.
POST /data-id/structured-data
safeDataId.getStructuredDataHandle(ACCESS_TOKEN, btoa(`${USER_PREFIX}:${filename}`), 501)
Get a structured data handle
The app obtains a structured data handle using the data ID handle of the file you opened.
GET /structured-data/handle/:dataIdHandle
safeStructuredData.getHandle(ACCESS_TOKEN, dataIdHandle)
After obtaining a structured data handle, the app drops the data ID handle of the file you opened.
DELETE /data-id/:handleId
safeDataId.dropHandle(ACCESS_TOKEN, dataIdHandle)
Fetch the metadata of the file
The app fetches the metadata of the structured data that contains all the versions of the file you opened.
GET /structured-data/metadata/:handleId
safeStructuredData.getMetadata(ACCESS_TOKEN, sdHandleId)
The app now knows the number of versions contained inside the structured data.
Fetch each version
The app reads each version of the structured data one by one.
GET /structured-data/:handleId/:version?
safeStructuredData.readData(ACCESS_TOKEN, sdHandleId, version)
After reading all the versions of the file you opened, the app displays them in the UI.

Last updated
Was this helpful?