Change or add object data to the Alfabet database

The endpoint update provide a means to alter the content of the Alfabet database. New objects can be created for Alfabet object classes, properties of existing objects can be changed, and relations between objects can be created. A single service call can include multiple different operations. This means you can create new objects and update data of existing objects in the same request, for example. As a result of the service call, the content of the Alfabet database is changed and a return value is sent that confirms the change.

The update of the data in the Alfabet database requires basic knowledge about the object class configuration of the Alfabet meta-model and/or existing object data:

  • For each object class, there is a database table in the Alfabet database with one column per property. Each object class has a REFSTR property. The REFSTR is unique for each object and used to define the relations between object class properties.
  • A relation between two objects is established via a property of one of the objects that is of the type Reference or ReferenceArray . Although different mechanisms exist for storage of relations for properties of the type Reference and ReferenceArrayReference or ReferenceArray , these differences are of no importance for the definition of the relation in the service call. This is handled by the Alfabet RESTful API on server side.
  • Use the endpoint object with the ReportResult field set to Objects to get information about the relevant object class properties and their current values.

Endpoint name: update

HTTP method: PUT

Service call: URLOfTheAlfabetAPIServer/api/v2/update

Authorization Header Field: Authorization:TypeValue

Click for details about authorization.

Additional Header Fields: Content-Type: application/json;charset=utf-8

Body: The body is a JSON object with the following structure:

Field Mandatory/Optional Required Value
"Objects" Optional An array containing the specification of the objects and the data that shall be changed for the objects.

Click for details about the field in the context of creating new objects.

Click for details about the field in the context of updating object data.

"Relations" Optional An array containing the specification of the references that shall be changed.

Click for details about the field.

"CurrentProfile" Mandatory The name of a user profile assigned to the Alfabet user sending the call that shall be used to access Alfabet. The user profile is required to evaluate whether the user that is sending the service call has write permissions to an object.

The Portfolio Admin user profile must be specified to execute object deletion via RESTful service calls.

"ApiCulture" Optional By default, number, date, and time information must be defined in the server call in the format of the standard language of your Alfabet installation.

You can set this field to AlfabetFastLane_API to specify number, date, and time values with the following patterns:

  • Date pattern: yyyy-MM-dd
  • Date time pattern: yyyy-MM-dd HH:mm:ss.fff
  • Time pattern: HH:mm:ss
  • Number pattern: The decimal symbol is a dot, the number of decimals is not limited and the group symbol is a comma (e.g. 3,125.987).

Return value: The return value is a JSON object informing about changes performed and errors that occurred. It can have the following fields:

Field Value
"NewObjects" This field contains a JSON object with one field for each new object. The field name is the ID defined in the request and the field value is the value of the REFSTR property of the new object in the Alfabet database. If the request only updates objects, this field is empty.
"Access Denied" This field contains a JSON object with a field for each object for which access is denied. The field name is the REFSTR value of the object and the field value is the reason for denial of access.
"RejectedObjects" This field provides information about objects that could not be created or changed. The field contains a JSON list of objects with one JSON object for each rejected change to an Alfabet object. The object has a field RefStr that returns the REFSTR of the Alfabet object and a field Message that provides information about the rejection.
"NotFound" If a relation shall be created and one or both of the involved objects does not exist in the Alfabet database, the call displays a NotFound field containing an array with the REFSTR values that could not be found.
"Count" This field provides information about the number of objects and relations that were updated or created.

Please note that the count for update and deletion of relations is not always identical to the number of relations that were requested to be updated or deleted via the call. This is due to internal mechanisms such as back relations that lead to two relations to be changed when one relation is requested to be changed. The returned count can therefore not be used to check the completeness of request execution.

For example, when creating a two new objects, the return value is:

  • {
    • "NewObjects": {
      • 1: "95-61-0",
      • 2: "95-62-0" }
    • "Count": 2
  • }