insertTokenWithTokenProperty()
insertTokenWithTokenProperty() API encrypts a plaintext value, creates a token, inserts token along with the tokenProperty into the token vault, and returns the token. The API supports Unicode (multibyte format) tokens.
If the passed plaintext value is already tokenized, this method simply returns the existing token. If the value is not already tokenized, but a collision occurs (the given token already exists) or the generated token matches the plaintext value, then CT-V repeats the tokenization process up to 100 attempts, to tokenize the plaintext value.
This method is also supported in batch mode.
Request URL
Url: http://localhost:8080/tmrest/SafeNetTokenManager/insertTokenWithTokenProperty
Url for Batch: http://localhost:8080/tmrest/SafeNetTokenManager/batch/insertTokenWithTokenProperty
Method
POST
Request Parameters
Parameters | Descriptions |
---|---|
naeUser | A Key Manager user with access to the AES and HMAC keys. |
naePassword | The Key Manager user’s password. |
dbUser (optional) | A database user with access to the token table. |
dbPassword (optional) | The database user’s password. |
values | The data to be tokenized. |
tableName | This is the Token Vault name and it must be in CAPITAL LETTERS. |
format | One of the predefined token formats or a format created using createNewFormat(). |
luhnCheck (optional) | boolean indicates if the value must pass a Luhn check (true) or if there is no requirement (false). Token formats created using the createNewFormat() method may have one of three luhnCheck rules, the rules are must fail test, no requirement, and must pass test. |
customData (optional) | The customer-specific data associated with each plaintext value. The default value is NULL. |
saveException (optional, only for batch) | boolean indicates if the Smart Check feature is applied (See Smart Check). When set to true, the feature is applied. The default value is FALSE. |
tokenProperty | A 16 bits alphanumeric string, attached to the token. |
customTokenProperty | A string of up to 255 characters including special characters. |
Note
Either tokenProperty, customTokenProperty or both must be used.
The priority of the luhnCheck boolean in insert() and the luhnCheck integer in createNewFormat() vary, depending on their values, as can be seen in this image:
Returned Values
String or string array of token(s) created for the input value(s).
TmResult (an object) which provides array of tokens, error indexes and messages.
Example
{
"naeUser":"admin",
"naePassword":"admin",
"dbUser":"user",
"dbPassword":"admin",
"tableName":"TABLE1",
"values":["123456677777722"],
"format":"1",
"tokenProperty":"1234567890987699",
"customTokenProperty":"abcd1234",
"customData":["Vendor name"]
}
Result
{
tokens: [1]
0:"050655135720137"
}