Skip to main content

Type Service

Type REST API

The Type REST API is a full CRUD API allowing you to search and filter actions as well as update, version and delete them. It is accessed through the following URL:

https://api.opendatadsl.com/api/type

The API consists of the following calls:

MethodPathExampleDescription
GETGet the build information for this service
GET{release}/{source}v1/public v1/privateList public or private types
GET{release}/{source}/{key}v1/private/TESTRetrieve a single type using its unique id
GET{release}/{source}/{key}/{version}v1/private/TEST/1Retrieve a version of a single type
GET{release}/{source}/{key}/*v1/private/TEST/*Get a list of versions for a specific type
PUT{release}/{source}/{key}/{version}/{tag}v1/private/TEST/1/PRODTag a version with a name (which can be used instead of the version number when retrieving it)
POST{release}v1Create or update a type, the type is the body of the POST request
DELETE{release}/{source}/{key}v1/private/TESTRollback to the previous version of a type, if it is the only version then the type will be deleted
DELETE{release}/{source}/{key}/{version}v1/private/TEST/1Delete a specific version of a type
DELETE{release}/{source}/{key}/*v1/private/TEST/*Fully delete a type, including all versions

Entities

Type Entity

The action entity contains the following information:

NameDescriptionType
_idUnique id for the typeString
_typealways 'Type'String
_nameThe name of the typeString
_versionedA boolean indicating if objects created from this type should be versioned - defaults to falseBoolean
{property}All other property names on the typeObject

Type properties

The property elements of the type contains all the defined properties, each property type has a different configuration.

Standard property

NameDescriptionType
nameThe name of the propertyString
_ptype'Property'String
typeThe type of the propertyString
displayNameText name of the propertyString
errorTextAn expression, which will be evaluated, to show if there is a validation issueString
qualifierUsed if the property type requires a qualifier, e.g. dimension typeString
defaultValueAn expression to generate a value if the property value passed in empty or nullString
sortIndexAn integer to define the sort order of propertiesInteger
fieldGroupAn optional group to place fields in to keep them together in a sectionString
bucketA bucketing aggregation expression to be used for filtering values for this propertyString
notnullA boolean indicating that this field does not allow null valuesBoolean
childrenA list of other properties defined as child properties of this oneList(Object)

Expression property

NameDescriptionType
nameThe name of the propertyString
_ptype'Expression'String
typeThe type of the propertyString
displayNameText name of the propertyString
errorTextError string to show if there is a validation issueString
expressionThe Base64 encoded expression to generate a valueString
sortIndexAn integer to define the sort order of propertiesInteger

Method property

NameDescriptionType
nameThe name of the propertyString
_ptype'Method'String
typeThe type of the propertyString
displayNameText name of the propertyString
errorTextError string to show if there is a validation issueString
methodThe Base64 encoded method expressionString

Examples

### Get build info
GET {{url}}/type
Authorization: Bearer {{token}}

### List all public types
GET {{url}}/type/v1/public
Authorization: Bearer {{token}}

### List all public type names
GET {{url}}/type/v1/public?_distinct=_name
Authorization: Bearer {{token}}

### List all private types
GET {{url}}/type/v1/private
Authorization: Bearer {{token}}

### List all private type names
GET {{url}}/type/v1/private?_distinct=_name
Authorization: Bearer {{token}}

### Get some private type names
GET {{url}}/type/v1/private
?_id=Address
&_id=Cable
&_id=Company
Authorization: Bearer {{token}}

### Get a public type
GET {{url}}/type/v1/public/%23Retailer
Authorization: Bearer {{token}}

### Get a private type
GET {{url}}/type/v1/private/Switch
Authorization: Bearer {{token}}

### Update a private type
POST {{url}}/type/v1
Authorization: Bearer {{token}}

{
"_id": "Test",
"_type": "Type",
"_name": "Test",
"_versioned": false,
"name": {
"name": "name",
"type": "String",
"_ptype": "Property"
}
}

### Get a list of versions of private type
GET {{url}}/type/v1/private/Test/*
Authorization: Bearer {{token}}

### Get a version of type
GET {{url}}/type/v1/private/Test/1
Authorization: Bearer {{token}}

### Tag a version of a type
PUT {{url}}/type/v1/private/Test/1/PROD
Authorization: Bearer {{token}}

### Get a tagged version of a type
GET {{url}}/type/v1/private/Test/PROD
Authorization: Bearer {{token}}

### Delete a version of a type
DELETE {{url}}/type/v1/private/Test
Authorization: Bearer {{token}}

### Fully delete a type
DELETE {{url}}/type/v1/private/Test/*
Authorization: Bearer {{token}}