Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

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

  • GET /api/v2/DataModels — List data models (paged)
  • GET /api/v2/DataModels/{id} — Get a model by UUID
  • GET /api/v2/DataModels/ByCode/{code} — Get a model by code

Custom properties:

  • GET /api/v2/DataModels/CustomProperties — List custom properties (filters + paging)
  • GET /api/v2/DataModels/CustomProperties/{id} — Get custom property by id
  • GET /api/v2/DataModels/CustomProperties/ByCode/{code} — Get custom property by code
  • POST /api/v2/DataModels/{modelId}/CustomProperties — Create custom property
  • PUT /api/v2/DataModels/CustomProperties/{id} — Update custom property (allowBreakingChanges optional)
  • DELETE /api/v2/DataModels/CustomProperties/{id} — Delete custom property

Query Parameters: /api/v2/DataModels/CustomProperties (GET)

ParameterTypeRequiredDescription
ModelIdstring (uuid)NoFilter by data model identifier
ModelCodestringNoFilter by data model code
ModelNamestringNoFilter by data model name
ModelWideSearchstringNoWide search across model's Name and Code fields
NamestringNoFilter by custom property name
CodestringNoFilter by custom property code
WideSearchstringNoWide search across custom property Name and Code fields
OrganizationIdstringNoFilter by organization identifier
OrganizationCodestringNoFilter by organization code
OffsetintegerNoPagination offset
LimitintegerNoMaximum number of results

Request Body: /api/v2/DataModels/{modelId}/CustomProperties (POST)

Schema: DataModelCustomPropertyCreateRequest

PropertyTypeRequiredDescription
organizationstringNoIdentifier or code of the organization the custom property belongs to
codestringYesCode of the custom property (unique within the model)
nameStringLocalizedValueYesLocalized display name of the custom property
descriptionStringLocalizedValueNoLocalized description of the custom property
isCollectionbooleanYesIndicates if the property is a collection (list) of values
isLocalizedbooleanYesIndicates if the property supports localization
fieldTypeDataModelFieldTypeYesData type of the field (see Common Data Types)
referencedEntityTypeIdsarray[uuid]NoList of referenced entity type IDs (for LookupEntity/NestedEntity types)
fieldValidationsarray[object]NoCollection of field validations

DataModelFieldType (enum)

  • Text — Single-line text
  • MultilineText — Multi-line text
  • TwoOptions — Boolean/Yes-No
  • WholeNumber — Integer
  • DecimalNumber — Decimal number
  • CurrencyNumber — Currency value
  • UniqueIdentifier — UUID/GUID
  • UtcDateTime — Date and time (UTC)
  • Date — Date only
  • LookupEntity — Reference to another entity
  • NestedEntity — Embedded entity
  • FileReference — File attachment
  • SingleSelectOptionSet — Single-choice dropdown
  • MultiSelectOptionSet — 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

References