insertToken()
insertToken() API encrypts plaintext value(s), creates token(s), inserts token(s) into the token vault(s), and returns the token(s). 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/insertToken
Url for Batch:http://localhost:8080/tmrest/SafeNetTokenManager/batch/insertToken
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. |
value(s) | 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. |
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 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":"jit",
"naePassword":"xxxxxxxx",
"dbUser":"sa",
"dbPassword":"xxxxxxxx",
"values":["23333333333333","2222222222222","4444444444444"],
"tableName":"test",
"format":"3"
}
Result
{
tokens: [3]
0:"25863143853333"
1:"4302578582222"
2:"6627979014444"
}