Everything You Need to Know

Detokenization

Multiple

Estimated reading: 3 minutes 36 views

Overview

The Multiple Detokenization API is used to detokenize multiple token values in a single request.

Each item in the request contains its own transaction ID, template name, and token value. OneDB processes each item individually and returns a response for each transaction.

This API is useful when an application needs to retrieve multiple protected values without calling the single detokenization API repeatedly.

Endpoint

POST https://<onedb-hostname>:8443/api/v1/detokenize?multiple

Request Headers

Authorization: Bearer {{ONEDB_BEARER}}
Content-Type: application/json

Request Body

[
  {
    "trxId": 50,
    "templateName": "App_Without_Masking",
    "token": "BmGNl WY4T8t7"
  },
  {
    "trxId": 51,
    "templateName": "App_With_Masking_Regex",
    "token": "769.1.0.5"
  },
  {
    "trxId": 52,
    "templateName": "App_With_Masking",
    "token": "8564-6135-2544-7410"
  }
]

Request Fields

Field Type Required Description
trxId Number Yes Unique transaction ID provided by the client application for tracking and audit reference.
templateName String Yes Name of the detokenization template configured in OneDB.
token String Yes Token value that will be converted back to the original data or protected output.

Successful Response

[
  {
    "trxId": 50,
    "success": true,
    "data": "shean hateway"
  },
  {
    "trxId": 51,
    "success": true,
    "data": "*********"
  },
  {
    "trxId": 52,
    "success": true,
    "data": "11**-****-****-**44"
  }
]

Successful Response Fields

Field Type Description
trxId Number Transaction ID returned from the request item.
success Boolean Indicates whether the detokenization request for the item was successful.
data String Detokenized value returned by OneDB. Depending on the template configuration, the returned value may be the original value or a masked value.

Partial Failed Response

If one or more items fail, OneDB returns a response for each item. Failed items contain success: false and an error message, while successful items contain the detokenized data.

[
  {
    "trxId": 50,
    "success": false,
    "message": "Invalid template name!"
  },
  {
    "trxId": 51,
    "success": true,
    "data": "*********"
  },
  {
    "trxId": 52,
    "success": true,
    "data": "11**-****-****-**44"
  }
]

Failed Response Fields

Field Type Description
trxId Number Transaction ID returned from the request item.
success Boolean Indicates whether the detokenization request for the item was successful. The value is false when the item fails.
message String Error message describing why the item failed.

Example Request Using cURL

curl -X POST "https://<onedb-hostname>:8443/api/v1/detokenize?multiple" \
  -H "Authorization: Bearer {{ONEDB_BEARER}}" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "trxId": 50,
      "templateName": "App_Without_Masking",
      "token": "BmGNl WY4T8t7"
    },
    {
      "trxId": 51,
      "templateName": "App_With_Masking_Regex",
      "token": "769.1.0.5"
    },
    {
      "trxId": 52,
      "templateName": "App_With_Masking",
      "token": "8564-6135-2544-7410"
    }
  ]'

Notes

  • This API requires a valid Bearer token.
  • The request body must be a JSON array.
  • Each item in the array is processed independently.
  • The trxId should be unique for each item to support tracking, troubleshooting, and audit reference.
  • The templateName must match an existing detokenization template configured in OneDB.
  • The token value must be a valid token generated by OneDB.
  • If one item fails, other valid items can still be processed successfully.
  • Applications should check the success value for each item in the response.
  • Depending on the template configuration, detokenization may return the original value or a masked value.
  • Access to detokenization APIs should be strictly controlled because they may expose sensitive data.
Share this Doc

Multiple

Or copy link

Table of Contents