/Storage/StoreInVault
Allows the client to store information security in the vault. The information is stored encrypted is secure storage, complying with stricty industry standards such as PCI/DSS. The resource can be used to store new information, or to update existing information. Masks can be provided to the information, so that when it is retrieved later, only the masked information is returned. In return for storing the information in the vault, an opaque identifier is returned. This identifier can be safely stored by the client, and used to retrieve the information later. This allows the client to avoid storing sensitive information locally.
JSON
- Request
{ "type": Required(Str(PType)), "clientId": Optional(Str(PClientId)), "vaultId": Optional(Str(PVaultId)), "Tags": { "name": Required(Str(PTagName)), "value": Required(Str(PTagValue)), "masked": Optional(Str(PTagMaskedValue)) }?[] }- Response (if successful)
{ "created": Required(DateTime(PCreated)), "updated": Required(DateTime(PUpdated)), "vaultId": Required(Str(PVaultId)) }
XML
- Request
<StoreInVault xmlns="https://waher.se/Schema/BrokerAgent.xsd" type=(Required(Str(PType))) clientId=(Optional(Str(PClientId))) vaultId=(Optional(Str(PVaultId)))> <Tags> <[ <Tag name=(Required(Str(PTagName))) value=(Required(Str(PTagValue))) masked=(Optional(Str(PTagMaskedValue))) />?[] ]> </Tags> </StoreInVault>- Response (if successful)
<Stored xmlns="https://waher.se/Schema/BrokerAgent.xsd" created=(Required(DateTime(PCreated))) updated=(Required(DateTime(PUpdated))) vaultId=(Required(Str(PVaultId)))/>
Input Parameters
| Parameter | Description |
|---|---|
PType |
An optional type string. Can be null. Client can define type strings to separate different types of information into different items. |
PClientId |
An optional Client Identifier used by the agent to separate sensitive information between clients it serves. Can be null. |
PVaultId |
An optional Vault Identifier. Can be null, which which case a new vault item is created. If provided, an existing vault item is upadted. |
PTagName |
The name of the information tag. |
PTagValue |
The value of the information tag. This value will be returned if unmasked values are requested. |
PTagMaskedValue |
The masked value of the information tag. This value will be returned if masked values are requested. |
Note: Vault items are unique to each agent account. An agent can only access vault items stored within its own account.
Response Parameters
| Parameter | Description |
|---|---|
PCreated |
When the vault item was created. |
PUpdated |
When the vault item was last updated. |
PVaultId |
The Identifier of the vault item. This identifier be safely stored by the client, in order to retrieve the information in the item later. |
Javascript Library
Use the following asynchronous method in the Javascript Library, to call this resource.
var Response = await AgentAPI.Storage.StoreInVault(VaultId,Type,ClientId,Tags);
Note: The Tags property in the function call is a vector of objects, each object having the corresponding property names that will be transmitted in the API call.