getValue()
getValue() gets the plaintext associated with a token or an array of tokens. This method is also supported in the batch mode.
Note
The plaintext for token generated using insertIrreversibleToken() method is not returned, instead the string value “Irreversible Token” is returned.
Request URL
Url:http://localhost:8080/tmrest/SafeNetTokenManager/getValue
Url for Batch:http://localhost:8080/tmrest/SafeNetTokenManager/batch/getValue
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. |
token(s) | A token or an array of tokens that corresponds to an encrypted value(s). |
tableName | This is the Token Vault name and it must be in CAPITAL LETTERS. |
customData (optional) | The customer-specific data associated with each plaintext value. Note: For MySQL, if the customData parameter is null or empty, then the getValue() API retrieves results for all customData values in token vault. |
format | The format of the returned value. Use one of the following options to set the format of the returned value: • SHOW_ALL or 0: Shows all characters of plaintext value. For example, 123456734562891024• SHOW_FIRST_SIX or 1: Shows only the first six characters of the plaintext value and masks the remaining characters. For example, a 16-digit credit card number will be mask as 123456XXXXXXXXXX.• SHOW_FIRST_TWO_LAST_FOUR or 2: Shows only the first two and last four characters of the plaintext value and masks the remaining characters. For example, a 16-digit credit card number will be masked as 12XXXXXXXXXX3456.• SHOW_FIRST_SIX_LAST_FOUR or 3: Shows only the first six and last four characters of the plaintext value and masks the remaining characters. For example, a 16-digit credit card number will be masked as 123456XXXXXX1234.• SHOW_LAST_FOUR or MASK_TOKEN or 6: Shows only the last four characters of the plaintext value and masks the remaining characters. For example, a 16-digit credit card number will be masked as XXXXXXXXXXXX1234.• Masking format ID can be generated using the createMaskingFormat API. |
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. |
Returned Values
String or string array of the decrypted value(s).
TmResult (an object) which provides array of decrypted value(s), error indexes and messages.
Example
{
"naeUser":"jit",
"naePassword":"xxxxxxxx",
"dbUser":"sa",
"dbPassword":"xxxxxxxx",
"tokens": ["25863143853333","4302578582222","6627979014444"],
"tableName":"test",
"format":"6",
"saveException":true
}
Result
{
values: [3]
0:"XXXXXXXXXX3333"
1:"XXXXXXXXX2222"
2:"XXXXXXXXX4444"
-
}