Export data about objects
The endpoint objects returns information about objects in the Alfabet database. In the service call, a preconfigured tabular report must be specified which returns data about a number of objects.
The following information is useful to understand the information about the service call:
- Each row in the report returns data about a base object. For configured reports returning data about objects of a specific object class, each object is a base object of the report and the base object is different for each row. For reports returning relations, the base object is the object the relation is established for. If an object has multiple relations, the base object will be identical in multiple rows. For example, if the configured report returns data about the assignment of applications to application groups and an application is assigned to two application groups, there will be two rows with this application as base object.
- Relations between objects are stored as references based on the object class property REFSTR of each object. REFSTR values are unique. If an object class property stores a relation to another object, the REFSTR value of the target object will be stored in the database.
- REFSTR values are composed of three numbers separated by a dash: 116-123-0. The first number is specific for the object class that the object belongs to and is the same for all objects of the same class. The second number is specific for the object. On object creation, an object is assigned a number +1 of the last created object. The third number is always zero.
- Some of the object classes in Alfabet are not independent object classes with own database tables but subtypes of a superordinate object class. For example, Physical Server and Virtual Server are both subtypes of the object class Device. The data for both physical servers and virtual servers is written in the database table of the object class Device. The technical term for a subtype used in the following is "object class stereotype".
You can return different sets of information via the endpoint:
- The response returns the data that is included in the report. This method is recommended because the report returns information in a readable way. For example, if an object references another object, the REFSTR value of the referenced object is stored in the database table, but the report will provide the name of the object as displayed in the user interface.
- The response returns information about all property values for all objects found in the report independent of the data defined in the dataset of the report.
- The response returns all REFSTR values of all objects found in the report. This kind of response is useful if the REFSTR values of a defined group of objects are required as input (for example, for external applications that shall provide links that open the Alfabet user interface).
Endpoint name: objects
HTTP method: POST
Service call: URLOfTheAlfabetAPIServer/api/v2/objects
Authorization Header: 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:
- {
- "CurrentProfile":"Portfolio Admin",
- "Language": 1033,
- "DataCulture": "fr-FR",
- "ApiCulture": "APICultureReporting",
- "EmptyValues": true,
- "Report": "Report_1",
- "ReportResult": "DataSet",
- "Limit": 500,
- "Offset": 250
- }
Field | Mandatory/Optional | Required Value |
---|---|---|
"Report":"ReportName" | Mandatory | The name of one of the configured reports that the call shall read data from. Click to view a list of available configured reports and the data returned by each report. |
ReportResult:"DataSet/References/Objects" | Mandatory |
ReportResult must be one of the following:
|
"Limit" : Number | Optional | This field defines the maximum number of objects that the response of the call shall return data for. This value may be set to limit data returned for reports including a high number of objects. In combination with the field Offset, this field can be used to fetch the result of a big report in multiple steps.
If Limit is not set, a maximum number of 1000 result data sets of the configured report are returned. |
"Offset" : Number | Optional | This field defines the start position for returning values in the result data set of the configured report. For example, if the Limit field is set to 20 and the Offset is set to 10, the results listed in row 11 to 30 in the tabular output of the configured report are returned in the service call. By default, the start position is the first row in the data set with the number 0. |
"ReportArgs":{"DATE":yyyymmdd"} | Optional | With this field, you can limit the return value to objects changed after the specied date if the report is configured to filter the data by last change date. The filter is available for all reports returning information about objects of a defined object class.
The date must be specified as YYYYMMDD. (for example, 20240125 for 25th of January 2024) |
"CurrentProfile":"Portfolio Admin" | Mandatory | The name of a user profile that shall be used to access Alfabet. The user profile is required to evaluate whether the user that is sending the service call is allowed to read data about an object. Use the Portfolio Admin user profile. |
"EmptyValues":true/false | Optional | This field is only relevant if the ReportResult field of the call is set to Objects.
If EmptyValues is set to true , all object class properties of the object are returned even if they are not set. If EmptyValues is set to false , only object class properties of the object that are set are returned. By default the attribute is set to false. |
"Language":"LanguageLCID" | Optional | To return all values in the original language and add translations in a second language, the parameter DataCulture shall be used instead of the parameter Language This field is only relevant if translations are available for string data of objects and the ReportResult field of the call is set to Objects . The field must specify the language code (LCID) decimal of the culture for which the translations are available in the Alfabet database. The standard language of the database is returned per default. If a translation is not available for a translatable object class property, no value will be returned, even if a value is provided in the standard language. Language supersedes DataCulture . If both fields are available, only Language is used. |
"DataCulture":"LanguageCode" | Optional | This field is only relevant if translations are available for string data of objects and the ReportResult field of the call is set to Objects . The field must specify either the language code of the culture for which translations are available in the Alfabet database, or ALL to return translations for all languages that provide translation. For example, the language code for German is de-DE. By default the standard language of the database is returned.
In addition to the values in the original language, translations are added to the return value in a separate field Translations. The field Language supersedes DataCulture . If both fields are available, only Language is used and DataCulture is ignored. |
"ApiCulture":"AlfabetFastLane_API" | Optional | This field is only relevant if the ReportResult field of the call is set to Objects . If it is not set, date and time information is returned in the standard language of your Alfabet installation.
You can set this field to AlfabetFastLane_API to return data and time values with the following patterns:
|
Return value
The return value depends on the setting of the ReportResult field of the call.
-
The call returns a JSON object with the following fields.
- Refs: A JSON array containing the REFSTR values of the base objects in the report. The array can contain a REFSTR value multiple times if the base object of multiple rows is identical.
- Count: The number of REFSTR values in the Refs field.
- Name: The name of the report which has been executed.
- Description: The description of the report which has been executed if a description is available in the report configuration.
-
The call returns a JSON object with the following fields.
-
Objects A list with one JSON object for each base object found in the executed report. The JSON object contains the following fields:
- ClassName: The name of the Alfabet object class that the object belongs to.
- RefStr: The value of the REFSTR of the object.
- Values: A JSON object that includes all information defined about the object in the database via object class properties. Each property is a field with a name corresponding to the property name. The value of the field provides information about the value of the property. The return value for a property depends on the value type of the property:
Property Type Return value String, Text The string, text is returned as string (in inverted commas): - "description":"This application manages customer relations."
StringArray All selected options of the string array are returned in one string: - "subcategories": "APP_SecurityAssessment APP_CloseSubworkflow"
Boolean Boolean values are 1 for true, 0 for false, or null if the property is not set: - "variant": 1
Real, Integer Real and integer values are returned as a number: - "xpos": 485.4
Date, DateTime Date and date time information are returned as date strings of the format yyyy-mm-dd: - "last_update": "2012-02-21"
URL URLs are returned as a string (in inverted commas): - "url": "http://company.com/ReportServer"
Reference The REFSTR of the object that the reference targets is returned: - "ictobject": "26-608-0"
ReferenceArray For reference arrays, the REFSTRs of all objects that the current object references with this property are listed in an array: - "applicationgroups": [3]
- 0: "95-38-0"
- 1: "95-8-0"
- 2: "95-9-0"
- GenericAttributes: If attributes are defined for the object via the object class GenericAttribute , all generic attributes with the object class property Owner set to the current object are listed in this field as a JSON list of objects. Each object in the list returns one object of the class GenericAttribute , with the fields Refstr , Values and Translations that return data about the generic attribute in the same format as returned for the main object.
- Count: The number of rows returned by the report.
- Name: The name of the report which has been executed.
- Description: The description of the report which has been executed if a description is available in the report configuration.
-
Objects A list with one JSON object for each base object found in the executed report. The JSON object contains the following fields:
-
-
Objects: A JSON list of objects with one JSON object per row in the dataset of the configured report. The object contains the following fields:
- ClassName: The name of the Alfabet object class that the base object of the current row belongs to.
- RefStr: The value of the REFSTR of the base object of the current row.
- Values: A JSON object that includes all information defined in the cells of the current row of the configured report. Each column in the dataset is a field with a name corresponding to the column name. The value of the field provides information about the value in the current row. All values are returned as strings.
- NestedObjects: This field is currently not used.
- Count: The number of rows returned by the report.
- Name: The name of the report that has been executed.
- Description: The description of the report that has been executed if a description is available in the report configuration.
-
Objects: A JSON list of objects with one JSON object per row in the dataset of the configured report. The object contains the following fields:
RESTful Service call:
Service call: https://AlfabetCloud/AlfabetAPIServer/api/v2/objects
HTTP method: POST
Headers:
- Authorization: bearer eyJ0eXAiOiJKVxMiJ9.eyJpc3MiOiJhbGZhYmV0IiwiaWF0IjoiMTU3MzAzMjA0NiIsImV4cCI6IjE1NzMwMzMyNDYiLCJxc2giOm51bGwsInN1YiI6IkFwaSBBdXRoZW50aWNhdGlvbiIsImNvbnRleHQiOnsidXNlciI6eyJVc2VyS2V5IjoiQUxGQUJFRDRUNGNc1R5cGUiOjB9fX0.PJC0EWtlUETbraV7NckVkRTFVm356y6K9JyhFR245hXp-2ApttryATZ_dAL0bi_GZpeJx7iqr_lRIA
- Content-Type: application/json; charset=utf-8
Body:
- {
- "CurrentProfile":"Portfolio Admin",
- "Report": "RAPI_ApplicationGroup",
- "ReportResult": "DataSet",
- "Limit": 500,
- "Offset": 250
- "ReportArgs":{"DATE":20240210"}
- }
Only one application group has been changed after the specified date.
Response of the service call:
- "Objects": [{
- "ClassName": "ApplicationGroup",
- "RefStr": "157-78-0",
- "Values": {
- "Name": "Financial Services Apps",
- "Parent": "Administrative Service Apps",
- Short Name: null,
- "Type": "Analysis Group"
- "Description": null;
- },
- "NestedObjects": {}
- }
- }],
- "Count": 001,
- "Name": "RAPI_ApplicationGroup"
- "Description": "";