Aliases

Aliases are a type of fact that provides a way to make any fact globally referenceable. The alias is an '@' prefixed name that can be used in any API call where a node id could be used. The alias stands in for the fact.

Example:

You have created a person entity

POST /write
{
    "nodeId": "00000000404AE4402DF969ACE2C2DA9133A23EA48773AF8A",
    "document": {
        "FullName": "John Watson",
        "FullAddress": "221b Baker Street, London, UK"
    }
}

To create a "Watson" alias for the entity you use the createalias API call.

POST /createalias
{
    "nodeId": "00000000404AE4402DF969ACE2C2DA9133A23EA48773AF8A",
    "name": "Watson"
}

This creates an alias "@Watson" that can be used anywhere the id "00000000404AE4402DF969ACE2C2DA9133A23EA48773AF8A" can be used.

The entity's data can now be read using the alias.

POST /read
{
    "nodeId": "@Watson",
    "template": [
        "FullName",
        "FullAddress"
    ]
}

Permissions

Note that just because you have created an alias on a node, it does not mean that the node is automatically publicly available. You still must set the appropriate permissions on the node.