Create a file
Contents

Create file
Get a data ID handle
Update the file index
Fetch file index

Last updated
Was this helpful?


Last updated
Was this helpful?
Was this helpful?
POST /structured-datasafeStructuredData.create(ACCESS_TOKEN,
// trying to come up with a name that is super unlikely to clash ever.
btoa(`${USER_PREFIX}:${filename}`),
// 501 => we want this versioned
501, payload, SYMETRIC_CYPHER_HANDLE)const payload = new Buffer(JSON.stringify({
ts: (new Date()).getTime(),
content: data
})).toString('base64');PUT /structured-data/:handleIdsafeStructuredData.put(ACCESS_TOKEN, handle)GET /structured-data/data-id/:handleIdsafeStructuredData.getDataIdHandle(ACCESS_TOKEN, handle)FILE_INDEX[filename] = dataHandleId;PATCH /structured-data/:handleIdsafeStructuredData.updateData(ACCESS_TOKEN,
INDEX_HANDLE,
new Buffer(JSON.stringify(FILE_INDEX)).toString('base64'),
SYMETRIC_CYPHER_HANDLE)POST /structured-data/:handleIdsafeStructuredData.post(ACCESS_TOKEN, INDEX_HANDLE)