Edit a file
When you want to edit an existing file, the app needs to load the content of that file.
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 want to edit. 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 want to edit.
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 want to edit.
DELETE /data-id/:handleId
safeDataId.dropHandle(ACCESS_TOKEN, dataIdHandle)
Fetch the file
The app reads the latest version of the structured data using the structured data handle of the file you want to edit.
GET /structured-data/:handleId/:version?
safeStructuredData.readData(ACCESS_TOKEN, handleId, version)
The app displays the Markdown content for the latest version of the file you want to edit.

Fetch all versions
The app fetches all the versions of the file and displays them in the UI.

Last updated
Was this helpful?