API
- Common Information
- aB-Agenta API Inbetriebnahme
- API Troubleshooting
- Object types, Properties and Selection lists
- Filter
Common Information
The aB-Agenta API enables third-party programs to access aB-Agenta data. To enable the API, you have to install the aB-Agenta webservice and configure the API options.How to do this and the meaning of the options you can see here.
The API offers these functions:
- load / search records
- modify records
- create new records
- delete records
- download documents
- upload new documents
The OpenAPI specifications can be found here: https://demoserver.artbase-software.de/api2_1/swaggerui
We recommend to use it on your own service with your own data and credentials to run tests that better suit your environment. (http(s)://your-server:port/api2_1/swaggerui)
Please keep in mind that aB-Agenta is not a cloud solution, but an offline application. The actual base url of your productive API is individual. There is no global API server. The url above is intended for testing purposes only.
aB-Agenta API Inbetriebnahme
Öffnen Sie aB-Agenta auf dem Rechner, auf dem aB-Agenta installiert ist und die "aB-Agenta Daten" liegen.
API Troubleshooting
Grundregel
- Bei Problemen zuerst sicherstellen, dass aB-Agenta auf die aktuelle Version aktualisiert ist. Viele Fehlerursachen sind bereits in neueren Versionen behoben.
Logdatei prüfen
- Im Unterordner logs liegt abserverservicefx.log. Viele Fehlerursachen können hier gefunden werden.
Service startet nicht
- Fehlkonfiguration → Einstellungen auf Korrektheit und Vollständigkeit prüfen
- Antivirus unterbindet Ausführung des Service → Ausnahme definieren
Service via localhost nicht erreichbar
- Port schon belegt → anderen Port ausprobieren
Service im LAN nicht erreichbar
- Port in Windows-Firewall gesperrt → Port öffnen via Button in Service-Einstellungen
- Port in Drittanbieter Software Firewall gesperrt → Port manuell öffnen
Service im WAN nicht erreichbar
- Port in Hardware-Firewall gesperrt → öffnen
- Router zwischen LAN und WAN → Port weiterleiten
- Verweist die Domain auf die korrekte öffentliche IP-Adresse?
- Ist die öffentliche IP-Adresse erreichbar?
Let’s Encrypt Zertifikat kann nicht ausgestellt werden
- Let’s Encrypt Port in lokaler oder Hardware-Firewall gesperrt → öffnen
- Let’s Encrypt muss im WAN auf Port 80 erreichbar sein. Ggf. entsprechende Port-Weiterleitung einrichten
- Service hat keine Schreibrechte auf Zertifikatsspeicher → Service als Benutzer mit Admin-Rechten betreiben
Anmeldung scheitert trotz korrekten Anmeldedaten
- Datenordner wurde aus Client Perspektive angegeben → aus Server Perspektive angeben
- Nicht ausreichende Zugriffsrechte auf Datenordner → Rechte für den Benutzer erteilen, der den Service ausführt
- Datenordner liegt im LAN auf Netzwerkfreigabe → der Benutzer „Lokales System“ kann nicht auf Netzwerkfreigaben zugreifen. Melden Sie den Service mit einem anderen Benutzer mit lokalen Administrator-Rechten an.
- Datenordner liegt auf Netzlaufwerk → Netzlaufwerke sind meistens für einzelne Benutzer definiert. Verwenden Sie stattdessen einen UNC-Pfad.
- Antivirus sperrt Zugriff auf Datenordner → Ausnahme definieren
- Datenordner wurde nicht (korrekt) im Service freigegeben → In Service-Einstellungen den Datenordner korrekt in Ordner-Freigabe eingeben. Schreibweise muss mit Datenordnereinstellung übereinstimmen. Siehe Log-Datei für erwartete Schreibweise.
- SQL-Server wurde nicht (korrekt) im Service freigegeben → In Service-Einstellungen die SQL-Server-Instanz korrekt in SQL-Server-Freigabe eingeben. Schreibweise muss mit Datenordnereinstellung übereinstimmen. Siehe Log-Datei für erwartete Schreibweise.
Kein Zugriff auf Dokumente
- Nicht ausreichende Zugriffsrechte auf ggf. abweichenden Dokumentenordner (Arbeitsplatzeinstellungen) → Rechte für den Benutzer erteilen, der den Service ausführt
- ggf. abweichender Dokumentenordner liegt im LAN auf Netzwerkfreigabe → der Benutzer „Lokales System“ kann nicht auf Netzwerkfreigaben zugreifen. Melden Sie den Service mit einem anderen Benutzer mit lokalen Administrator-Rechten an.
Object types, Properties and Selection lists
In aB-Agenta, data is available in a specific structure. It consists of records, each of which belongs to a specific object type and has multiple properties and values.Object types
- "Standardadressen" - ID: "-6"
- "Agenturen / Mitarbeiter" - ID: "-62"
Properties
- 1=text
- 2=integer
- 3=decimal
- 4=date
- 5=boolean
- 6=memo (long text)
- 7=time
- 8=currency (decimal with only two decimal places)
- 9=date-time
- 11=true-false-unknown (tristate type: true=1, false=2, unknown=0)
- 1=standard
- 2=reference (to another record by its id, like a foreign key)
- 3=encoded (the value is always an integer that has a bigger meaning; encoded properties always have an encoded selection list thats values are used)
- 8=image (references an image document -which is a normal record too- so it is a variant of the type 2)
Selection lists
encoded
: records MUST store a value of one of the list entries (field "value" in list-entries)
non-encoded
: records may save any value. The list entries are merely suggestions. (field "name" in list-entries)
Filter
loadrecords
andloadobjecttypes
functions is a complex JSON object representing the query criteria.Filter classes
Comparer
{field name: {operator: value}}{field name: {operator: [value1, value2, ...]}}{field name: [{operator1: value1},{operator2: value2},...]}{$system_id: {$equals, "123456"}} ≙ select * from tab where system_id='123456'
comparison operations
| Operator | Value (data type) | Description | Example | corresponds to this SQL query |
| $isEmpty | bool | true only; field has empty value; identical to $isNull | {system_id: {$isEmpty: true}} | system_id IS NULL |
| $notEmpty | bool | true only; field has no empty value | {system_id: {$notEmpty: true}} | system_id<>'' |
| $isNull | bool | true only; field value is NULL | {system_id: {$isNull: true}} | system_id IS NULL |
| $notNull | bool | true only; field value is not NULL | {system_id: {$notNull: true}} | system_id IS NOT NULL |
| $equals | any | field value equals comparison value | {system_id: {$equals: "7"}} shorthand: {system_id: "7"} | system_id='7' |
| $notEquals | any | field value not equal to comparison value | {system_id: {$notEquals: "7"}} | system_id<>'7' |
| $endswith | string | field value ends with comparison value | {system_id: {$endswith: "7"}} | system_id LIKE '%7' |
| $startswith | string | field value starts with comparison value | {system_id: {$startswith: "7"}} | system_id LIKE '7%' |
| $contains | string | fiel value contains comparison value | {system_id: {$contains: "7"}} | system_id LIKE '%7%' |
| $like | string | field value matches the pattern | {system_id: {$like: "%7_7%"}} | system_id LIKE '%7_7%' |
| $in | any[] | field value equals one of the comparison values | {system_id: {$in: ["7","8","9"]}} | system_id IN ('7','8','9') |
| $notIn | any[] | field value not equal to any of the comparison values | {system_id: {$notIn: ["7","8","9"]}} | system_id NOT IN ('7','8','9') |
| $between | any[2] | field value lies between the two comparison values | {system_id: {$between: ["7","9"]}} | system_id BETWEEN '7' AND '9' |
| $notBetween | any[2] | field value not lies between the two comparison values | {system_id: {$notBetween: ["7","9"]}} | system_id NOT BETWEEN '7' AND '9' |
| $gt | any | field value is greater than comparison value | {system_id: {$gt: "7"}} | system_id > '7' |
| $gte | any | field value is greater than or equal to comparison value | {system_id: {$gte: "7"}} | system_id >= '7' |
| $lt | any | field value is less than comparison value | {system_id: {$lt: "7"}} | system_id < '7' |
| $lte | any | field value is less than or equal to comparison value | {system_id: {$lte: "7"}} | system_id <= '7' |
| $equals_field | string | field value is equal to specified other field | {system_last_change_at: {$equals_field: "system_created_at"}} | system_last_change_at = system_created_at |
| $notEquals_field | string | field value not equal to specified other field | {system_last_change_at: {$notEquals_field: "system_created_at"}} | system_last_change_at <> system_created_at |
| $gt_field | string | field value is greater than specified other field | {system_last_change_at: {$gt_field: "system_created_at"}} | system_last_change_at > system_created_at |
| $gte_field | string | field value is greater than or equal to specified other field | {system_last_change_at: {$gte_field: "system_created_at"}} | system_last_change_at >= system_created_at |
| $lt_field | string | field value is less than specified other field | {system_last_change_at: {$lt_field: "system_created_at"}} | system_last_change_at < system_created_at |
| $lte_field | string | field value is less than or equal to specified other field | {system_last_change_at: {$lte_field: "system_created_at"}} | system_last_change_at <= system_created_at |
| $between_field | string[2] | field value lies between the values of two other specified fields | {system_last_change_at: {$between_field: ["system_created_at","system_delete_at"]}} | system_last_change_at BETWEEN system_created_at AND system_delete_at |
| $notBetween_field | string[2] | field value not lies between the values of two other specified fields | {system_last_change_at: {$notBetween_field: ["system_created_at","system_delete_at"]}} | system_last_change_at NOT BETWEEN system_created_at AND system_delete_at |
| $date | int | Date/Time only: day of month equals comparison value | {system_created_at: {$date: 1}} | DAY(system_created_at) = 1 |
| $day | int | Date/Time only: weekday equals comparison value | {system_created_at: {$day: 1}} | DATEPART(dw, system_created_at) = 1 |
| $year | int | Date/Time only: year equals comparison value | {system_created_at: {$year: 2000}} | YEAR(system_created_at)=2000 |
| $month | int | Date/Time only: month equals comparison value | {system_created_at: {$month: 12}} | MONTH(system_created_at)=12 |
| $minutes | int | Date/Time only: minute equals comparison value | {system_created_at: {$minutes: 59}} | DATEPART(mi, system_created_at) = 59 |
| $hours | int | Date/Time only: hour equals comparison value | {system_created_at: {$hours: 18}} | DATEPART(hh, system_created_at) = 18 |
ALL
{$all: true} ≙ select * from tab where 1=1EMPTY
{$empty: true} ≙ select * from tab where 1=0NOT
{$not: {system_id: "7"}} ≙ select * from tab where NOT (sytem_id='7')AND
{$and: [{vertragsnummer: {$contains: {"123"}}, {vertragsnummer: {$notEquals: "100123100"}}, ...]} ≙ select * from tab where vertragsnummer like '%123%' AND vertragsnummer <> '100123100' AND ...{vertragsnummer: {$contains: {"123"}, vertragsnummer: {$notEquals: "100123100"}, ...}OR
{$or: [{vertragsnummer: {$contains: {"123"}}, {vertragsnummer: {$notEquals: "100123100"}}, ...]} ≙ select * from tab where vertragsnummer like '%123%' OR vertragsnummer <> '100123100' OR ...Combination of Shorthands
{name: "Albrecht", vorname: "Klaus"} ≙ select * from tab where name='Albrecht' AND vorname='Klaus'Nesting
{$or: [{$and: [filter1, filter2], $not: {$or: [filter3, filter4]}]} ≙ select * from tab where (filter1 AND filter2) OR NOT(filter3 OR filter4)