Get Data Type
Retrieve a specific data type by type identifier.
Endpoint
Retrieves a single data type with its complete configuration including regex patterns or group members.
Authentication
Requires any valid API Key. All keys have read access.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
type |
string | Data type identifier |
Response
Returns the complete data type object:
Response Format
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "EMPLOYEE_ID",
"name": "Employee ID",
"description": "Company employee identifier format",
"disabled": false,
"isGroupDataType": false,
"isBuiltIn": false,
"regexes": [
{
"regex": "EMP-[0-9]{6}",
"json": "",
"html": "",
"valueGroupIndex": 0
}
],
"createdAt": 1704067200,
"updatedAt": 1704153600
}
Response Fields
| Field | Type | Description |
|---|---|---|
id |
UUID | Unique data type identifier |
type |
string | Type identifier |
name |
string | Display name |
description |
string | Description |
disabled |
boolean | Whether type is disabled |
isGroupDataType |
boolean | Whether this is a group type |
isBuiltIn |
boolean | Whether this is a built-in type (cannot be modified) |
regexes |
array | Regex patterns (only for regex types) |
dataTypes |
array | Member type UUIDs (only for group types) |
createdAt |
integer | Unix timestamp when created |
updatedAt |
integer | Unix timestamp of last update |
Examples
Get Data Type by Type
Retrieve a specific data type to view its configuration.
import requests
BASE_URL = "https://your-shield-host:8080"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
datatype_type = "EMPLOYEE_ID"
response = requests.get(f"{BASE_URL}/api/datatypes/{datatype_type}", headers=HEADERS)
dt = response.json()
print(f"Data Type: {dt['name']}")
print(f"Type: {dt['type']}")
print(f"Is Group: {dt['isGroupDataType']}")
print(f"Built-in: {dt['isBuiltIn']}")
print(f"Disabled: {dt['disabled']}")
const axios = require('axios');
const BASE_URL = 'https://your-shield-host:8080';
const HEADERS = { 'Authorization': 'Bearer YOUR_API_KEY' };
const datatypeType = 'EMPLOYEE_ID';
const response = await axios.get(`${BASE_URL}/api/datatypes/${datatypeType}`, { headers: HEADERS });
const dt = response.data;
console.log(`Data Type: ${dt.name}`);
console.log(`Type: ${dt.type}`);
console.log(`Is Group: ${dt.isGroupDataType}`);
console.log(`Built-in: ${dt.isBuiltIn}`);
console.log(`Disabled: ${dt.disabled}`);
Error Responses
| Status Code | Description |
|---|---|
401 |
Invalid or expired API key |
404 |
Data type not found |
Related Topics
- List Data Types - Query all data types
- Update Data Type - Modify this data type
- Delete Data Type - Remove this data type
- Disable Data Type - Enable or disable this data type