OneDB API
Overview
The OneDB API provides a secure REST interface for applications and services to perform data protection operations.
Applications can use the OneDB API to protect sensitive data before storage, reveal protected data when authorized, apply masking rules, and check service availability.
Typical API use cases include:
- Tokenization
- Detokenization
- Multiple Tokenization
- Multiple Detokenization
Base URL
Use the following base URL for all API requests:
https://<onedb-hostname>/api/v1
Example:
https://onedb.company.com/api/v1
Authentication
All API requests must be authenticated.
OneDB API supports token-based authentication. The access token must be included in the Authorization header.
Authorization: Bearer <access_token>
Example:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI...
Standard Headers
The following headers are recommended for API requests:
Content-Type: application/json
Authorization: Bearer <access_token>
X-Request-ID: <unique-request-id>
Header
Required
Description
Content-Type
Yes
Must be
application/json
Authorization
Yes
Bearer token used to authenticate the request
X-Request-ID
Optional
Unique request ID for tracking and troubleshooting
Response Format
Most of OneDB API responses return a JSON object that indicates whether the request was processed successfully.
Each response includes a transaction ID, a success status, and either the requested result or an error message.
Successful Response
A successful response contains success:true and the response data generated by the API.
{
"trxId": 100,
"success": true,
"token": "3324-1991-5516-0208"
}
Error Response
A failed response contains success: false and an error message describing why the request could not be processed.
{
"trxId": 100,
"success": false,
"message": "Invalid template name!"
}
General Response Fields
For a simpler documentation page, you can also combine them like this:
| Field | Type | Required | Description |
|---|---|---|---|
trxId |
Number | Yes | Unique transaction ID assigned to the API request. This can be used for tracking, troubleshooting, and audit reference. |
success |
Boolean | Yes | Indicates the result of the API request. Returns true when the request is successful and false when the request fails. |
token |
String | Conditional | Returned when the API successfully generates a token. |
| data | String | Conditional | Returned when the API successfully generates a data. |
message |
String | Conditional | Returned when the API request fails or when additional information needs to be provided. |