DataService API v2 — DataModels
Base URL
https://demo.avaplace.com/api/asol/ds
Authentication
- OAuth2 Bearer token required (scope:
apiim) - See DataService-API.md for token acquisition
Overview
What it covers
- Browse model definitions
- Resolve models by code
- Manage custom properties (CRUD)
Endpoints
/api/v2/DataModels— List data models (paged)/api/v2/DataModels/{id}— Get a model by UUID/api/v2/DataModels/ByCode/{code}— Get a model by code
Custom properties:
/api/v2/DataModels/CustomProperties— List custom properties (filters + paging)/api/v2/DataModels/CustomProperties/{id}— Get custom property by id/api/v2/DataModels/CustomProperties/ByCode/{code}— Get custom property by code/api/v2/DataModels/{modelId}/CustomProperties— Create custom property/api/v2/DataModels/CustomProperties/{id}— Update custom property (allowBreakingChangesoptional)/api/v2/DataModels/CustomProperties/{id}— Delete custom property
Query Parameters: /api/v2/DataModels/CustomProperties (GET)
| Parameter | Type | Required | Description |
|---|---|---|---|
ModelId | string (uuid) | No | Filter by data model identifier |
ModelCode | string | No | Filter by data model code |
ModelName | string | No | Filter by data model name |
ModelWideSearch | string | No | Wide search across model's Name and Code fields |
Name | string | No | Filter by custom property name |
Code | string | No | Filter by custom property code |
WideSearch | string | No | Wide search across custom property Name and Code fields |
OrganizationId | string | No | Filter by organization identifier |
OrganizationCode | string | No | Filter by organization code |
Offset | integer | No | Pagination offset |
Limit | integer | No | Maximum number of results |
Request Body: /api/v2/DataModels/{modelId}/CustomProperties (POST)
Schema: DataModelCustomPropertyCreateRequest
| Property | Type | Required | Description |
|---|---|---|---|
organization | string | No | Identifier or code of the organization the custom property belongs to |
code | string | Yes | Code of the custom property (unique within the model) |
name | StringLocalizedValue | Yes | Localized display name of the custom property |
description | StringLocalizedValue | No | Localized description of the custom property |
isCollection | boolean | Yes | Indicates if the property is a collection (list) of values |
isLocalized | boolean | Yes | Indicates if the property supports localization |
fieldType | DataModelFieldType | Yes | Data type of the field (see Common Data Types) |
referencedEntityTypeIds | array[uuid] | No | List of referenced entity type IDs (for LookupEntity/NestedEntity types) |
fieldValidations | array[object] | No | Collection of field validations |
DataModelFieldType (enum)
Text— Single-line textMultilineText— Multi-line textTwoOptions— Boolean/Yes-NoWholeNumber— IntegerDecimalNumber— Decimal numberCurrencyNumber— Currency valueUniqueIdentifier— UUID/GUIDUtcDateTime— Date and time (UTC)Date— Date onlyLookupEntity— Reference to another entityNestedEntity— Embedded entityFileReference— File attachmentSingleSelectOptionSet— Single-choice dropdownMultiSelectOptionSet— Multi-choice dropdown
StringLocalizedValue
{
"values": [
{ "locale": "en-US", "value": "English text" },
{ "locale": "cs-CZ", "value": "Český text" }
]
}
Example validation objects:
// Required validation
{ "validation": "Required", "allowEmptyStrings": false }
// String max length
{ "validation": "StringMaxLength", "maxLength": 100 }
// Range validation
{ "validation": "Range", "minimum": 0, "maximum": 999, "minimumIsExclusive": false, "maximumIsExclusive": false }
// Regex validation
{ "validation": "Regex", "pattern": "^[A-Z]{2}\\d{4}$" }
Examples
List data models
curl
curl -X GET "https://demo.avaplace.com/api/asol/ds/api/v2/DataModels?Offset=0&Limit=50" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"
PowerShell
Invoke-RestMethod -Method Get `
-Uri 'https://demo.avaplace.com/api/asol/ds/api/v2/DataModels?Offset=0&Limit=50' `
-Headers @{ Authorization = "Bearer $accessToken"; Accept = 'application/json' }
Postman
- Method:
GET - URL:
{{baseUrl}}/api/v2/DataModels?Offset=0&Limit=50 - Authorization: Bearer Token
Create a custom property
This adds a custom field to an existing data model.
curl
curl -X POST "https://demo.avaplace.com/api/asol/ds/api/v2/DataModels/<modelId>/CustomProperties" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"organization": "<orgIdOrCode>",
"code": "ExternalSystemId",
"name": { "values": [ { "locale": "en-US", "value": "External System Id" } ] },
"description": { "values": [ { "locale": "en-US", "value": "Identifier from a 3rd-party system" } ] },
"isCollection": false,
"isLocalized": false,
"fieldType": "Text",
"referencedEntityTypeIds": [],
"fieldValidations": [ { "validation": "StringMaxLength", "maxLength": 64 } ]
}'
PowerShell
$uri = 'https://demo.avaplace.com/api/asol/ds/api/v2/DataModels/<modelId>/CustomProperties'
$body = @{
organization = '<orgIdOrCode>'
code = 'ExternalSystemId'
name = @{ values = @(@{ locale = 'en-US'; value = 'External System Id' }) }
description = @{ values = @(@{ locale = 'en-US'; value = 'Identifier from a 3rd-party system' }) }
isCollection = $false
isLocalized = $false
fieldType = 'Text'
referencedEntityTypeIds = @()
fieldValidations = @(@{ validation = 'StringMaxLength'; maxLength = 64 })
} | ConvertTo-Json -Depth 10
Invoke-RestMethod -Method Post `
-Uri $uri `
-Headers @{ Authorization = "Bearer $accessToken"; Accept = 'application/json' } `
-ContentType 'application/json' `
-Body $body
Postman
- Method:
POST - URL:
{{baseUrl}}/api/v2/DataModels/<modelId>/CustomProperties - Authorization: Bearer Token
- Body → raw → JSON: same payload as above