Documentation Index
Fetch the complete documentation index at: https://docs.ownid.com/llms.txt
Use this file to discover all available pages before exploring further.
Retrieve Data Block by Type
The Retrieve Data Block endpoint is responsible for fetching the block data (Profile or Session) from your database. OwnID will send a request to this endpoint, specifying the block type it needs to retrieve.
app.get('/providers/storage/:blockType', (req, res) => {
const { blockType } = req.params;
// Simulate fetching block data from your database
const blockData = getBlockData(blockType);
if (blockData) {
res.status(200).json(blockData);
} else {
res.status(404).send('Data for the specified blockType not found.');
}
});
Set/Update Data Block by Type
app.post('/providers/storage/:blockType', (req, res) => {
const { blockType } = req.params;
const newData = req.body;
// Simulate updating block data in your database
const success = updateBlockData(blockType, newData);
if (success) {
res.status(200).send('Data updated successfully.');
} else {
res.status(404).send('Data for the specified blockType not found.');
}
});