Custom Schema Type
Retrieves all custom schema types.
Your Emporix tenant name.
Note: Always write the tenant name in lowercase.
^[a-z][a-z0-9]+$Page number to be retrieved. The number of the first page is 1.
1Number of items to be retrieved per page.
60List of properties used to sort the results, separated by colons. The order of properties indicates their priority in sorting.
Possible values:
{fieldName}{fieldName}:asc{fieldName}:desc
Note: If you want to sort the results by localized properties, the possible values are:
{fieldName}.{language}{fieldName}.{language}:asc{fieldName}.{language}:desc
If the sorting direction is not specified, the fields are sorted in ascending order.
A standard query parameter is used to search for specific values.
- Searching for items by string-based properties:
- By a field value:
q=siteCode:main, wheresiteCodeis the field name, andmainis its desired value. - By a localized field value:
q=items.product.name.en:apple_lobo, wherenameis the field name of product,enis the language code, andapple_lobois the field value expressed in the specified language. Note: This query works only for localized fields, which are stored in a map format, wherekeyis the language code andvalueis the translation to particular language.
- By a field value:
- Searching for items by a number-based property:
- With a specific value:
q=items.quantity.quantity:20 - With a value greater than:
q=items.quantity.quantity:>20 - With a value lower than:
q=items.quantity.quantity:<20 - With a value greater than or equal to:
q=items.quantity.quantity:>=20 - With a value lower than or equal to:
q=items.quantity.quantity:<=20 - With a value within a range of values:
q=items.quantity.quantity:(>=10 AND <=20)
whereitems.quantity.quantityis the name of the number-based field, and20is its querying value.
- With a specific value:
- Searching for items by a date-based property: All number-based property queries are also valid for dates. In that case, the date should be placed within double quotes:
q=metadataCreatedAt:(>="2021-05-18T07:27:27.455Z" AND <"2021-05-20T07:27:27.455Z") - Searching for items by a boolean-based property:
q=description.multiLanguage:true, wheredescription.multiLanguageis the boolean field name, andtrueis its desired value. - Searching for items with a nonexistent or empty property:
q=description.en:null, wheredescription.enis the field that has its value set tonull. - Searching for items with an existing property:
q=mixins.mixinName:exists, where the specific mixin namedmixinNameexists in the database. - Searching for items by multiple specific values:
q=id:(5c3325baa9812100098ff48f,5c3325d1a9812100098ff494), whereidis the field name, and strings within the bracket are the desired values. - Searching for items by multiple fields:
q=id:5c3325baa9812100098ff48f siteCode:mainwhereidandsiteCodeare field names. All objects that contain the specified values are returned. Multiple fields (separated by space) can be specified. Multiple values for each field can also be specified in the format presented earlier. - Searching for items with string-based properties conforming to a regex:
q=siteCode:~ainorq=code:(~U PL)- in case of searching for strings with space, wheresiteCodeis the name of the field, andainorU PLis its querying regex. - Searching for items with a localized string-based property conforming to a regex:
items.product.name.en:~(Yoghurt im)- wherenameis the product field name,enis the desired language, andJoghurt imis the search term.
siteCode:{main}Fields to be included in the response.
Determines whether the response will include information about associated schemas.
falseFlag indicating whether the total number of retrieved items should be returned.
falseExample: trueList of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields. If a value is specified, then it must be present in the tenant configuration.
- If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.
- If the header is set to
*, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages. - If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.
Given request is unauthorized - the authorization token is invalid or has expired. It usually means that the tenant from the token does not match tenant from path.
Permission denied due to insufficient rights. This may happen when the request does not contain sufficient scopes for the given query values.
GET /schema/{tenant}/custom-entities HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
{
"id": "CUSTOM_PRODUCT",
"name": {
"en": "Custom Product Type"
},
"metadata": {
"createdAt": "2023-08-09T09:21:42.693Z",
"modifiedAt": "2023-08-09T09:21:42.693Z",
"version": 1
}
},
{
"id": "DOCUMENT",
"name": {
"en": "Documents"
},
"metadata": {
"createdAt": "2023-08-10T10:15:30.123Z",
"modifiedAt": "2023-08-19T10:15:30.123Z",
"version": 2
}
}
]Creates a custom type entity that can be later used for creating custom instances.
Note: When a custom entity type is created, a set of custom scopes is created, which allow managing custom instances of that type.
Reserved built-in type IDs cannot be used as custom schema type IDs. This includes AVAILABILITY and LOCATION.
- : Required for managing schemas.
Your Emporix tenant name.
Note: Always write the tenant name in lowercase.
^[a-z][a-z0-9]+$The Content-Language request HTTP header defines language(s) of the payload.
deUnique code for the custom type. Can contain uppercase letters, digits, and underscores. The first character must be a letter.
Localized custom type name in a form of a map of translations.
The request was successful. Custom schema type has been created.
Id of the created schema.
ID of the generated document.
Unsupported content language provided.
Given request is unauthorized - the authorization token is invalid or has expired. It usually means that the tenant from the token does not match tenant from path.
Permission denied due to insufficient rights. This may happen when the request does not contain sufficient scopes for the given query values.
Conflict.
POST /schema/{tenant}/custom-entities HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 59
{
"id": "CUSTOM_PRODUCT",
"name": {
"en": "Custom Product Type"
}
}{
"id": "CUSTOM_PRODUCT"
}Retrieves a single custom schema type by id.
Your Emporix tenant name.
Note: Always write the tenant name in lowercase.
^[a-z][a-z0-9]+$Unique id of the custom type.
Determines whether the response will include information about associated schemas.
falseList of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields. If a value is specified, then it must be present in the tenant configuration.
- If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.
- If the header is set to
*, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages. - If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.
Unique id of the custom schema type.
Localized custom type name in a form of a map of translations.
Information about associated schemas. This field is only included if expandSchemas is set to true
Given request is unauthorized - the authorization token is invalid or has expired. It usually means that the tenant from the token does not match tenant from path.
Permission denied due to insufficient rights. This may happen when the request does not contain sufficient scopes for the given query values.
Given resource cannot be found.
GET /schema/{tenant}/custom-entities/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "CUSTOM_PRODUCT",
"name": {
"en": "Custom Product Type"
},
"metadata": {
"createdAt": "2023-08-09T09:21:42.693Z",
"modifiedAt": "2023-08-09T09:21:42.693Z",
"version": 1
}
}Performs the UPSERT operation. If a custom schema type with specified ID exists in the system, then it is updated. If it doesn't exist, a new type is created.
Note: When a custom entity type is created, a set of custom scopes is created, which allow managing custom instances of that type.
- : Required for managing schemas.
Your Emporix tenant name.
Note: Always write the tenant name in lowercase.
^[a-z][a-z0-9]+$Unique id of the custom type.
The Content-Language request HTTP header defines language(s) of the payload.
deLocalized custom type name in a form of a map of translations.
Custom schema type was successfully created.
Id of the created schema.
ID of the generated document.
Custom schema type was successfully updated.
Unsupported content language provided.
Given request is unauthorized - the authorization token is invalid or has expired. It usually means that the tenant from the token does not match tenant from path.
Permission denied due to insufficient rights. This may happen when the request does not contain sufficient scopes for the given query values.
Version validation failed.
PUT /schema/{tenant}/custom-entities/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 62
{
"name": {
"en": "Updated Custom Type"
},
"metadata": {
"version": 1
}
}{
"id": "CUSTOM_PRODUCT"
}Deletes a single custom type. This operation will fail if there are schemas or custom instances assigned to this custom type.
Note: Removing a custom entity type does not remove the custom scopes that were created when the type was added. Those scopes remain in the system until you remove them manually, if needed.
- : Required for managing schemas.
Your Emporix tenant name.
Note: Always write the tenant name in lowercase.
^[a-z][a-z0-9]+$Unique id of the custom type.
Custom schema type was succefully removed
No content
Bad request. This may happen when there are schemas or custom instances associated with this custom type.
Given request is unauthorized - the authorization token is invalid or has expired. It usually means that the tenant from the token does not match tenant from path.
Permission denied due to insufficient rights. This may happen when the request does not contain sufficient scopes for the given query values.
DELETE /schema/{tenant}/custom-entities/{id} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
No content
Last updated
Was this helpful?

