getToken()
getToken() API checks if a token exists for a plaintext value. If the token exists, the value is returned, else null is returned. This method is overloaded to handle values and customData arrays.
Syntax
public String getToken (String value, String customData, String table) throws
public String[] getToken (String[] values, String[] customData, String table) throws TokenException
Request Parameters
Parameters | Data Types | Descriptions |
---|---|---|
value | string or string[] | A plaintext value, or an array of values. |
customData | string[] | Customer-specific data. |
table | string | This is the Token Vault name and it must be in CAPITAL LETTERS. |
Note
For My SQL, if the customData parameter is null or empty, then the getToken() API returns results for all customData values in the token vault.
Returned values
Returned token or array of token(s).
Exception
Throws Exception
if:
The table is missing.
The input value is null.
The values and customData arrays are not of the same size.
There is a problem accessing the keys on the CT-V.
A customData element is too long or too short.
Example
getToken("5541997351273456", null, "CREDIT_CARD_NUMBERS")