Create Token for own RelationshipTemplate
Creates a Token for a given RelationshipTemplate.
Parameters
templateId
is theid
of the RelationshipTemplate the Token should be created for.expiresAt
is the ISODateTime the Token expires at.ephemeral
indicates if the Token should be ephemeral and thus not be stored and cached on the local database. This is especially useful for Tokens which are created regularly, e.g. for RelationshipTemplates and doesn’t need to be stored.forIdentity
can be set to an enmeshed address. If set, only the Identity with thataddress
can load the Token from the Backbone. If the RelationshipTemplate is already personalized via itsforIdentity
property, the Token created from it must have the same personalization.passwordProtection
can be specified as an object for PasswordProtection of a Token. If set, only the Identities that know the password specified within thepasswordProtection.password
property of the Token can load it from the Backbone. In addition, the optional propertypasswordProtection.passwordIsPin
can be used to configure the UI of the App in case the password is a pin. If the RelationshipTemplate is already password protected via itspasswordProtection
property, the Token created from it must have the same password protection.
On Success
- Returns the created
Token
.
On Failure
templateId
does not resolve to a RelationshipTemplate.- The RelationshipTemplate is owned by another Identity, which means that the value of its
isOwn
property isfalse
. expiresAt
lies in the past.- The RelationshipTemplate is personalized via its
forIdentity
property and the Token does not have the same personalization via itsforIdentity
property. - The RelationshipTemplate is password protected via its
passwordProtection
property and the Token does not have the same password protection via itspasswordProtection
property. - In case of password protection of the Token, a
passwordProtection.password
that does not consist of 4 to 16 digits was specified, but the value ofpasswordProtection.passwordIsPin
was nevertheless set totrue
.