REST API

Authentication

Login

Before you can call the API methods, you must authenticate using api/login via HTTP post with the parameters username and password. Only administrators or ETL users can login.
api/login?username=test&password=test
Any subsequent HTTP requests will need to use the received session cookie to authenticate themselves.

Logout

A session is ended with the following command:
api/logout

Ping

You can test if the Scope server is ready and responding with api/ping. You do not need to be logged in to do this.

JSON Result:

Ready

Whether the user is logged in and can use the interface is checked with api/isApiReady.

JSON Result:

Read values

Query current values for element ids

Request
To retrieve form values for a set of elements, specify the list of element ids and the list of field ids. If the list of field ids is empty, all fields are returned. Additionally, a list of element states can be passed for filtering. If the list of element states is empty, the values of all elements in the set of element ids are returned, regardless of their state.
api/getCurrentValuesForElements?elementIds=[Id](&elementIds=[Id])*(&entryIds=[Id])*(&states=[String])*
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. elementIds contains a list of valid elements, entryIds a list of valid fields, states the possible element states of the returned elements, and datasheets contains the list of datasheets of all valid elements.
Example

The values of fields 4, 5 and 6 are to be read for elements 11 and 12.

GET URL:

api/getCurrentValuesForElements?elementIds=11&elementIds=12&entryIds=4&entryIds=5&entryIds=6

JSON Result:

Get value history for element ids

Request
To retrieve all versions of form values for a set of elements, specify the list of element ids and the list of field ids. If the list of field ids is empty, all fields are read. You can also pass a list of element states to filter on. If the list of element states is empty, the values of all elements in the set of element ids are read, regardless of their state.
api/getValueHistoryForElements?elementIds=[Id](&elementIds=[Id])*(&entryIds=[Id])*(&states=[String])*
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. elementIds contains a list of valid elements, entryIds a list of valid fields, states the possible element states of the returned elements, and datasheets contains the list of datasheets of all valid elements.
Example

The values of fields 4 and 5 are to be read for elements 11 and 12.

GET URL:

api/getValueHistoryForElements?elementIds=11&elementIds=12&entryIds=4&entryIds=5&entryIds=6

JSON Result:

Get current values of a layout

Request
To retrieve all form values for a single layout of an element, use the getValuesForLayout method. If the element state is specified, a result will only be returned if the current state matches the specified state.
api/getValuesForLayout?elementId=[Id]&layoutId=[Id](&state=[String])?
No special rights are required for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. elementId contains the id of the queried element, layoutId the id of the queried layout, state the current element state, and datasheet the datasheet with the values.
Example

The values of layout 4 are to be read for element 11.

GET URL:

api/getValuesForLayout?elementId=11&layoutId=4

JSON Result:

Get the value history of a layout

Request
To retrieve all versions of form values of a single layout, use the getValueHistoryForLayout method.
api/getValueHistoryForLayout?elementId=[Id]&layoutId=[Id](&entryIds=[Id])*
it is recommended to query only the required fields. If no field ids are specified, the response will contain all visible fields of the layout. The list of authors is populated only if the user.versionAuthor.visible switch is active in the configuration.
No special rights are required for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. elementId contains the id of the queried element, layoutId the id of the queried layout, entryIds a list of valid fields, and datasheet the datasheet with the values. The values are sorted in ascending order by version date.
Example

The values of fields 4 and 5 of layout 4 are to be read for element 11.

GET URL:

api/getValueHistoryForLayout?elementId=11&layoutId=4&entryIds=4&entryIds=5

JSON Result:

Get values for a type

Request
To retrieve form values of all elements of an aspect type, specify the name of the aspect type and the level depth. Here, level 0 corresponds to the root node level.
api/nodes?typeName=[String]&level=[Id](&states=[String])+(&entries=[String])*
You will need administrative privileges for this request.
The following values are allowed as element status: IMAGINARY, IN_PLANNING, ACTIVE, ON_HOLD, CLOSED, REJECTED or ARCHIVED.
Result
The result is a list of maps in JSON format. A list item corresponds to the form values of an element. The form values are returned as a map, where the field name is the key and the field content is the value.
Example

All invoice numbers and order numbers whose elements have the status ACTIVE or ON_HOLD are to be returned from the aspect type Billing of level 1 (subnode of root node).

GET URL:

api/nodes?typeName=Billing&level=1&entries=InvoiceNumber&entries=OrderNumber&states=ACTIVE&states=ON_HOLD

JSON Result:

Get table view

Request
To be able to retrieve form values of an aspect type, you specify the name of the aspect type and the level depth. Level 0 is the root node level.
api/getTableViewData?tableViewId=[Id](&filterCondition=[String])?(&elementIdsFilter=[String])?(&entryIdsFilter=[String])?(&valueType=simple)?
No special rights are required for this request.
The following values are allowed as element status: IMAGINARY, IN_PLANNING, ACTIVE, ON_HOLD, CLOSED, REJECTED or ARCHIVED.
Result
The result is a map in JSON format. The tableViewData parameter describes the TableView with its columns and rows.
Example

The TableView with Id 1 is to be read, limited to the specified elements and fields for which the order date is before today.

GET URL:

api/getTableViewData?tableViewId=1&filterCondition=@OrderDate<TODAY&elementIdsFilter=23,24,25,28&entryIdsFilter=25

JSON Result with simple values:

JSON Result with extended values:

Update values

Change values with an ETL description

Request
An ETL import can be triggered with the following API URL:
api/performETL?etl=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format that contains a success flag as its only value, indicating whether the request was processed successfully.
Example

A new Project 125 is to be created as a process. For better readability the URL was not escaped.

GET URL:

api/performETL?etl="15";"3";"1";"0";"myCRM";"Project 125";"";"Project";"Project 125";""

JSON Result:

Write data sheet values

Request
In addition to ETL import, new values for a single datasheet can also be written using the following API URL.
api/writeDatasheet?elementId=[Id]&values=[JSON-Array](&layoutId=[Id])
This request requires write permissions for the fields to be written on the (optionally) specified layout of the element. If no layout id is passed, the software tries to write the values on the default element layout.
Result
The result is a map in JSON format that contains a flag success indicating whether the request was processed successfully. The elementId and layoutId parameters are also returned. If no layout id was provided by the caller, the id of the default layout used as a fallback is returned.
Example
The value "30,50 €" should be written into the number field "Amount" (REWOO Scope internal Id 42) for the order "Order 12440" (REWOO Scope internal Id 1020). The standard layout of the element is to be used as layout (this has the REWOO Scope internal Id 99).

GET URL:

api/writeDatasheet?elementId=1020&values=[{"entryId":42,"value":{"value":30.50,"unit":"€"},"state":"VALID","isFormula":false,"timestamp":null}]"

JSON Result:

Notes on the example
In the example, the value is intentionally not assigned a timestamp (attribute "timestamp"), but null, since this would be overwritten by the current server time when writing the values anyway.

Trigger CopyButton

Request
A CopyButton can be triggered by the following method:
api/copyByButton?elementId=[Id]&buttonId=[Id](&actorId=[Id])(&sourceElementId=[Id])(&targetIds=[Id])*&copyName=[String]&values=[JSON-Array]&connectionButtonExecutions=[JSON-Array]
This request requires access rights to the corresponding CopyButton. To perform the operation on behalf of another account, you need administrative rights to the system. The Die sourceElementId can be omitted if the copy button is configured with only one possible source.
Result
The result is a map in JSON format that contains a success flag whether the request was successfully processed and a list of element ids that were created during copying.
Example

On the node 23 the CopyButton 45 is to be pressed for the user 2. The template 8 is to be copied under the nodes 12 and 14.

GET URL:

api/copyByButton?elementId=23&buttonId=45&actorId=2&sourceElementId=8&targetIds=12&targetIds=14&copyName=Test&values=[{"Name":"Request", "Date": "2018-03-18T09:14:18.674Z"}]&connectionButtonExecutions=[]

JSON Result:

Trigger ActionButton

Request
An ActionButton can be triggered by the following method:
api/executeActionButton?elementId=[Id]&buttonId=[Id](&actorId=[Id])?(&layoutId=[Id])?(&buttonData=[JSON])?
No special rights are required for this request unless an actor id is specified. Only with administrative rights a button can be pressed on behalf of other accounts.
Button Data
Some buttons require the input of data for execution. This can be passed in buttonData.
  • Create report:
    {
        "params": [
            {
                "name": String,
                "type": ["BOOLEAN" | "CHOICE" | "DATE" | "MULTIPLE_CHOICE" | "NUMBER" | "STRING"],
                "editable": [ true | false ],
                "value": Primitive
            }
        ]
    }
  • Change selection options:
    [
        {
            "choiceOptionsPropagation": ["CHANGE" | "RENAME" | "REORDER"],
            "choiceOptions": Comma Separated String
        }
    ]
  • Execute ETL:
    {
        "etlData": CSV String,
        "locale": ["en_US" | "en_GB" | "de_DE"]
    }
Result
The result is a map in JSON format that contains a success flag indicating whether the request was successfully processed and the task ID of the launched job.
Example

On node 23, the ActionButton 45 on layout 24 is to be pressed for user 2.

GET URL:

api/executeActionButton?elementId=23&buttonId=45&actorId=2&layoutId=24

JSON Result:

Elements

Get element ids of a type

Request
The list of all elements of a type can be read with the getElementIdsForType method. If the type name is not globally unique, you can also specify the element type (OBJECT, PROCESS, ASPECT, NODE or CONNECTION). The following values are allowed as element status: IN_PLANNING, ACTIVE, ON_HOLD, CLOSED, REJECTED or ARCHIVED. If no status is specified, only elements with the status IN_PLANNING, ACTIVE or ON_HOLD are listed.
api/getElementIdsForType?typeName=[String](&elementType=[String])?(&states=[String])*
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. elementIds is an id list of the found elements.
Example

All active nodes of type invoice are searched.

GET URL:

api/getElementIdsForType?typeName=Invoice&elementType=NODE&states=ACTIVE

JSON Result:

Get elements

Request
To reduce the number of queries, you can use the getElementsForTypeIds method to query short element descriptions for multiple types at once.
api/getElementsForTypeIds?typeIds=[Id](&typeIds=[Id])*(&states=[String])*
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. elements is a list of element objects.
Example

All active elements of type 2 are searched.

GET URL:

api/getElementsForTypeIds?typeIds=2&states=ACTIVE

JSON Result:

Get a node (Deprecated)

Request
A single node of a given type can be read with the following API URL:
api/findNode?nodeName=[String]&aspectTypeName=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. node is a map describing the requested node.
Example

The employee node Homer Simpson is to be read.

GET URL:

api/findNode?nodeName=Homer%20Simpson&aspectTypeName=Employee

JSON Result:

Get connections

Request
All relations of a given type can be listed with the following API URL:
api/getConnectionsForType?typeName=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. connections contains a list of the connections found.
Example

All connections of type employee2order are to be listed.

GET URL:

api/getConnectionsForType?typeName=employee2order

JSON Result:

Request
A search query over all forms and files is started with the following URL:
api/search?term=[String]&page=[Number]&pageSize=[Number]
No special rights are required for this request.
The search query is any text. The page numbers start at 0. The result contains a maximum of hits for the search query according to the page size.
Result
The result is a map in JSON format. In term is the processed search query, in the list results the found results. The single result is a map with elementId (Scope ID of the found element), name (element name), datasheetVersion (Timestamp of the value containing the search hit), breadcrumb (List of parent elements as maps with elementId and name).
Example

The text REWOO is to be searched for. Expected is the second page with a maximum of 2 entries.

GET URL:

api/search?term=rewoo;page=1;pageSize=2

JSON Result:

Get node types

Request
The list of all node types can be queried with the following API URL:
api/getNodeTypes
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. nodeTypes contains the list of node types.
Example

GET URL:

api/getNodeTypes

JSON-Result:

Get Id of a form field

Request
For form fields, the scope ID can be queried using the following API URL:
api/getEntryForTitle?entryTitle=[String]&typeName=[String](&elementType=[String])?
You will need administrative privileges for this request.
The following values are allowed as element type: OBJECT, PROCESS, ASPECT or CONNECTION.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. entry is a map that describes the form field.
Example

The field InvoiceNumber is to be queried from the aspect type Invoice.

GET URL:

api/getEntryForTitle?entryTitle=InvoiceNumber&typeName=Invoice&elementType=ASPECT

JSON Result:

Get form fields of a type

Request
Form fields of a type can be queried with the following API URL:
api/getEntriesByTypes?entryType=[String](&typeIds=[Id])*(&typeNames=[String])*
You will need administrative privileges for this request.
The following values are allowed as field types: ActionButton, Boolean, Choice, Condition, ConnectionButton, CopyButton, Date, ElementLinks, Email, EmailFiles, ExternalLinks, FileLinks, Image, MultipleChoice, NextLinks, Number, PrevLinks, RichText, Signature, SpreadsheetFile, String, TrafficLight, ViewButton.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. entries is a list of field descriptions.
Example

All fields of the type FileLinks are to be queried from element type 2.

GET URL:

api/getEntriesByTypes?entryType=FileLinks&typeIds=2

JSON Result:

Get form fields

Request
The full description of form fields can be retrieved with the following API URL:
api/getDatasheetEntries?entryIds=[Id](&entryIds=[Id])*
No special rights are required for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. entryIds contains the list of queried field ids and entries the list of field descriptions.
Example

Fields 2 and 3 are to be queried.

GET URL:

api/getDatasheetEntries?entryIds=2&entryIds=3

JSON Result:

Get names for an Id

Request
The display name for an Id can be queried with the following URL:
api/resolveIdToName?entityId=[Id]&entityType=[ ELEMENT | TYPE | ENTRY | ATTACHMENT ]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. entityName contains the name you are looking for.
Example

The name of an element is to be queried.

GET URL:

api/resolveIdToName?entityId=17&entityType=ELEMENT

JSON Result:

Get layout by name

The following query can be used to determine the layout that has the specified name and belongs to the element type (also specified by name).
api/getLayoutForName?layoutName=[String]&typeName=[String]&elementType=[String]
You will need administrative privileges for this request.
The following values are allowed as element type: OBJECT, PROCESS, ASPECT or CONNECTION.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. layout contains the information about the searched layout. In layoutName, typeName and elementType the values are entered which were passed to the function when it was called.
Example

The layout "CustomerView" (internal REWOO Scope Id 7) of the object type "Order" (internal REWOO Scope Id 10) is to be read.

GET URL:

api/getLayoutForName?layoutName=CustomerView&typeName=Order&entityType=OBJECT

JSON Result:

Den Status von Elementen ändern

Request
Um den Status von Elementen zu verändern, benutzt man die Methode changeElementState. Die Methode ignoriert alle Elemente, für die der Statuswechsel nicht möglich ist und gibt alle Element-Ids zurück, für die der Statuswechsel erfolgreich war.
api/changeElementState?(elementIds=[Id]&)+newState=[String]&recursive=[Boolean]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. elementIds enthält die Ids der erfolgreich geänderten Elemente.
Example

Es soll der Status der Elemente 11,12,13 auf ARCHIVED geändert werden. Das Element ist schon archiviert.

GET URL:

api/changeElementState?elementIds=11&elementIds=12&elementIds=13&newState=ARCHIVED&recursive=false

JSON Result:

Dateien

Datei lesen

Request
Beim Auslesen von Formularen enthalten Felder mit Dateien Listen von Ids. Um auf diese Dateien zugreifen zu können, wandelt man die Ids mit folgender Anfrage in URLs um:
api/getFileUrl?attachmentId=[Id]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. url ist die URL, mit der auf die Datei zugegriffen werden kann und in originalFilename steht der Dateiname, den die Datei beim Speichern hatte.
Example

Es soll die Datei mit der Id 42 ausgelesen werden.

GET URL:

api/getFileUrl?attachmentId=42

JSON Result:

Datei speichern

Request
Eine Datei kann mit folgender URL in Scope gespeichert werden:
api/saveFileByUrl?elementId=[Id]&entryId=[Id]&url=[String]&(filename=[String])?(&overwriteAll=[Boolean])?
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. attachmentId enthält die Id der gespeicherten Datei.
Example

Es soll eine Datei gespeichert werden. Zur besseren Lesbarkeit wurde die URL nicht escaped.

GET URL:

api/getFileUrl?elementId=17&entryId=48&url=//home/rewoo/test.docx

JSON Result:

Geänderte Dateien abfragen

Request
Alle Dateien, die nach einem definierten Zeitpunkt geändert wurden, können mit folgender URL abgefragt werden:
api/getChangedFiles?since=[timestamp](&entryId=[Id])
You will need administrative privileges for this request.
Der Zeitpunkt since wird in Millisekunden seit Unix Epoch angegeben (01.01.1970 00:00:00.000 UTC). Die Ergebnisliste kann auf ein bestimmtes Formularfeld eingeschränkt werden. Alle abgefragten Dateien können für eine kurze Zeit über die zurückgegebene Url ohne Login abgerufen werden.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. files enthält die Id der gespeicherten Datei.
Example

Es werden alle geänderten Dateien seit 01.05.2019 15:23:00 in allen Instanzen von Feld 23 abgefragt.

GET URL:

api/getChangedFiles?since=1556716980000&entryId=23

JSON Result:

Externe Jobs

Fortschritt eines externen Jobs melden

Request
Der Fortschritt von externen Jobs kann über folgende URL an Scope weitergegeben werden:
api/updateTaskProgress?taskId=[Id]&progressIncrement=[Number]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. taskId enthält die verwendete TaskId.
Example

Der Task mit der Id 17 ist bei 35%.

GET URL:

api/updateTaskProgress?taskId=17&progressIncrement=0.35

JSON Result:

Daten für einen externen Job abfragen

Request
Die für einen externen Job notwendigen Daten können über folgende URL abgefragt werden:
api/getTaskPayload?taskId=[Id]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. taskId enthält die TaskId, payload die Daten.
Example

Lese die Daten für Task 17.

GET URL:

api/updateTaskProgress?taskId=17

JSON Result:

Scope als Proxy benutzen

Request
Scope kann als Proxy für andere Webanwendungen benutzt werden. In Scope müssen diese Dienste mit Namen und URL hinterlegt werden. Dann können diese Dienste über folgende API-URL indirekt angesprochen werden. Scope fügt dem Aufruf noch folgende Parameter hinzu
  • scopeUserId - Id des aktuell angemeldeten Anwenders
  • scopeUserHomeId - Id des Home-Knotens des aktuell angemeldeten Anwenders
  • scopeAccountType - Account-Art des Anwenders
  • scopeTimestamp - Zeitpunkt des Aufrufs
api/proxy?method=[String]&(param=[String])*
No special rights are required for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In message steht im Fehlerfall eine Nachricht, die Aufschluss über mögliche Probleme gibt. result enthält das Ergebnis des externen Service.
Example

Finde ein Meeting-Raum für 10 Personen.

GET URL:

api/proxy?method=findRoom&size=10

JSON Result:

Accounts

Accounts auflisten

Request
Mit folgender API-URL können alle Accounts vom Typ Admin, Power, Standard und Concurrent ausgelesen werden:
api/getScopeUsers?filter=[String]
Dabei steht [String] für eine Map in Form eines JSON-Strings, der die zu findenden Benutzer nach ihrem Gültigkeitsdatum und ob sie deaktiviert bzw. nicht deaktiviert sind, filtert. Wichtig ist bei der Angabe des Zeitstempels, die Anzahl der Millisekunden nach "Epoch" (01.01.1970, 00:00:00 GMT) anzugeben. Der Filter ist optional: wird er weggelassen, werden ausschließlich noch ungelöschte, nicht-deaktivierte Benutzer zurückgegeben.
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. scopeUsers ist die Liste der Ergebnisse. Unter filter ist der ursprünglich angegebene Filter zu sehen, der für die Benutzersuche verwendet wurde. Das einzelne Ergebnis ist eine Map mit den Attributen des jeweiligen Scope-Accounts.
Example

GET URL:

api/getScopeUsers?filter={"validUntil":1511790000000,"deactivated":true}
Liefert alle Benutzer zurück, die ein Gültigkeitsdatum kleiner oder gleich dem 27.11.2017, 13:40 UTC haben und deaktiviert wurden.

JSON Result:

Account anlegen

Request
Mit folgender API-URL kann ein neuer Account basierend auf einem Account-Template von Scope angelegt werden:
api/createUserByTemplate?templateName=[String]&realName=[String]&email=[String]&targetName=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. newUser ist eine Map mit den Attributen des neuen Scope-Accounts.
Example

GET URL:

api/createUserByTemplate?templateName=Springfield&realName=Simpson%2C%20Lisa&email=lisa.simpson@rewoo.com&targetName=Lisa%20Simpson

JSON Result:

Account aktualisieren

Request
Mit folgender API-URL kann ein bestehender Account aktualisiert werden:
api/updateUserInfo?userId=[Id]&realName=[String]&email=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. updatedUser ist eine Map mit den Attributen des aktualisierten Scope-Accounts.
Example

GET URL:

api/updateUserInfo?userId=3&realName=Flanders%2C%20Lisa&email=lisa.flanders@rewoo.com

JSON Result:

LDAP abfragen

Request
Über den Scope-Server können beliebige LDAP-Anfragen mit folgender API-URL gestartet werden:
api/performLdapQuery?(attributeFilter=[String])+(&searchBase=[String])?(&searchFilter=[String])?
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. ldapQueryResult ist die Liste der Ergebnisse. Das einzelne Ergebnis ist eine Map mit den angeforderten Attributen.
Example

Gesucht sind alle Rewoo-Nutzer, die unterhalb der Search-Base ou=people,dc=rewoo,dc=lan aufgehängt sind. Als Rückgabe-Werte werden displayName und uid erwartet.

GET URL:

api/performLdapQuery?attributeFilter=displayName&attributeFilter=uid&searchBase=ou%3Dpeople%2Cdc%3Drewoo%2Cdc%3Dlan&searchFilter=(&(objectclass%3DinetOrgPerson)(objectclass%3DRewooUser))

JSON Result:

LDAP-Account anlegen

Anfrage
Mit folgender API-URL kann ein neuer Account basierend auf einem existierenden LDAP-Eintrag und einem Account-Template von Scope angelegt werden:
api/createLdapUserByTemplate?templateName=[String]&userName=[String]&realName=[String]&email=[String]&targetName=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. newUser ist eine Map mit den Attributen des neuen Scope-Accounts.
Example

GET URL:

api/createLdapUserByTemplate?templateName=Springfield&userName=l.simpson&realName=Simpson%2C%20Lisa&email=lisa.simpson@rewoo.com&targetName=Lisa%20Simpson

JSON Result:

LDAP-Konfiguration auslesen

Request
Die LDAP-Konfiguration des Scope-Servers kann mit folgender API-URL ausgelesen werden:
api/getLdapUserConfig
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. ldapUserConfig ist eine Liste der Konfigurationsparameter.
Example

GET URL:

api/getLdapUserConfig

JSON Result:

Key-Value-Store

Key-Value-Store: mit einzelnem Schlüssel abfragen

Request
Mit folgender API-URL kann ein Wert aus dem Key-Value-Store von Scope für externe Anwendungen ausgelesen werden:
api/getExternalAppValue?appId=[String]&key=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. value enthält den nachgefragten Wert.
Example

GET URL:

api/getExternalAppValue?appId=myApp&key=country

JSON Result:

Key-Value-Store: mit Schlüssel-Präfix abfragen

Request
Mit folgender API-URL können Werte mit einem Schlüssel-Präfix aus dem Key-Value-Store von Scope für externe Anwendungen ausgelesen werden:
api/getExternalAppValuesByPrefix?appId=[String]&keyPrefix=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. keyValues enthält eine Map mit Key-Value-Paaren.
Example

GET URL:

api/getExternalAppValuesByPrefix?appId=myApp&keyPrefix=color

JSON Result:

Key-Value-Store: Wert schreiben

Request
Mit folgender API-URL kann ein Wert in den Key-Value-Store von Scope für externe Anwendungen geschrieben werden:
api/writeExternalAppValue?appId=[String]&key=[String]&value=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem.
Example

GET URL:

api/writeExternalAppValue?appId=myApp&key=country&value=Germany

JSON Result:

Key-Value-Store: alle Werte löschen

Request
Mit folgender API-URL können alle Werte im Key-Value-Store von Scope für eine bestimmte externe Anwendungen gelöscht werden:
api/clearExternalAppValues?appId=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem.
Example

GET URL:

api/clearExternalAppValues?appId=myApp

JSON Result:

Webhooks

Webhook anmelden

Request
Ein Webhook ist eine URL, die bei Auftreten eines Events aufgerufen wird. Momentan werden zwei Events unterstützt:
  • cron - der Scheduler hat den Job mit dem angegebenen Namen erfolgreich ausgeführt
  • value_change - Werte von Formularen des angegebenen Typs wurden geändert
api/addWebhook?event=[ cron | value_change ]&name=[String]&url=[String]&login=[String]&password=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem.
Example

GET URL:

api/addWebhook?event=value_change&name=Rechnungen&url=https://rewoo.de/test&login=test&password=test

JSON Result:

{
	"success": true,
	"event": "VALUE_CHANGE",
	"name": "Rechnungen" 		
}
Payload des Events CRON
Wenn der Scheduler einen Job erfolgreich ausgeführt hat, schickt er an alle für dieses Event registrierten Webhooks folgenden Payload im JSON-Format:
{
	"event": "CRON",
	"jobName": "UpdateTODAYDependenciesJob"
}
Payload des Events VALUE_CHANGE
Wenn Werte von Formularen geändert wurden, schickt Scope an alle für dieses Event registrierten Webhooks folgenden Payload im JSON-Format:
{
	"event": "VALUE_CHANGE",
	"elementType": "Rechnungen",
	"elements": [3,8,12]
}

Webhook abmelden

Request
Mit folgendem Aufruf können Webhooks wieder abgemeldet werden.
api/removeWebhook?event=[ cron | value_change ]&name=[String]&url=[String]
You will need administrative privileges for this request.
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem.
Example

GET URL:

api/removeWebhook?event=value_change&name=Rechnungen&url=https://rewoo.de/test

JSON Result:

Mehrere Operationen

Mehrere Operationen in einer Transaktion ausführen

Request
Mit folgender API-URL können mehrere der oben aufgelisteten Operationen in einer Transaktion ausgeführt werden, damit sichergestellt ist, dass entweder alle Operationen oder keine durchgeführt wurde:
api/executeAtomic?appId=[String]
Result
The result is a map in JSON format. success is a flag indicating whether the request was processed successfully. In case of an error, message contains a message that provides information about the problem. results ist eine Map mit dem Namen der Operation und dem Ergebnis.
Example

Es soll ein neuer Account angelegt werden und zusätzlich die vom Active Directory vergebene global eindeutige Id im Key-Value Store der Scope-internen Account-ID zugeordnet werden, damit der Account im Active Directory zugeordnet werden kann. Die im ersten Schritt erzeugte Scope-ID kann über den Platzhalter %<Operationsname>.<Ergebnisparameter>% referenziert werden.

GET URL:

api/executeAtomic?actions=[{"actionName"="createUserByTemplate","staticParams"={"templateName"="Springfield","realName"="Simpson, Lisa","email"="lisa.simpson@rewoo.com","targetName"="Lisa Simpson"},"dynamicParams"={}},{"actionName"="writeExternalAppValue","staticParams"={"appId"="myRestTool","key"="GUID-5ca3e4d3-8b6a-469a-8ff3-9eb61b9f7265"},"dynamicParams"={"value"="%createUserByTemplate.newUser.id%"}}]

JSON Result: