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:

Change the status of elements

Request
To change the status of elements, use the changeElementState method. The method ignores all elements for which the status change is not possible and returns all element IDs for which the status change was successful.
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 contains the IDs of the successfully changed elements.
Example

The status of elements 11,12,13 should be changed to ARCHIVED.

GET URL:

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

JSON Result:

Files

Read file

Request
When reading forms, fields with files contain lists of IDs. To access these files, the IDs are converted into URLs with the following request:
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 is the URL to access the file, and originalFilename is the name the file had when it was saved.
Example

The file with the ID 42 is to be read.

GET URL:

api/getFileUrl?attachmentId=42

JSON Result:

Save file

Request
A file can be saved in Scope with the following URL:
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 contains the ID of the saved file.
Example

A file is to be saved. For better readability, the URL has not been escaped.

GET URL:

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

JSON Result:

Get changed files

Request
The following URL can be used to retrieve all files modified after a specified date:
api/getChangedFiles?since=[timestamp](&entryId=[Id])
You will need administrative privileges for this request.
The time since is given in milliseconds since Unix Epoch (1970-01-01 00:00:00.000 UTC). The result list can be restricted to a specific form field. All queried files can be retrieved for a short time via the returned url without login.
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 contains the ID of the saved file.
Example

All changed files since 2019-01-05 15:23:00 are queried in all instances of field 23.

GET URL:

api/getChangedFiles?since=1556716980000&entryId=23

JSON Result:

Report the progress of an external job

Report the progress of an external Job.

Request
The progress of external jobs can be reported to Scope via the following URL:
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 contains the task ID.
Example

The task with ID 17 is 35% complete.

GET URL:

api/updateTaskProgress?taskId=17&progressIncrement=0.35

JSON Result:

Request the payload of an external job

Request
The data required for an external job can be queried via the following URL:
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 contains the task ID, payload the requested data.
Example

Lese die Daten für Task 17.

GET URL:

api/updateTaskProgress?taskId=17

JSON Result:

Use Scope as proxy

Request
Scope can be used as a proxy for other web applications. These services must be stored in Scope with a name and URL. Scope adds the following parameters to the call
  • scopeUserId - Id of the currently logged in user
  • scopeUserHomeId - Id of the home node of the user
  • scopeAccountType - Account type of the user
  • scopeTimestamp - Timestamp of the call
These services can then be addressed indirectly via the following API URL:
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. message contains a possible error message. result contains the return value of the proxied web application.
Example

Find a meeting room for 10 people.

GET URL:

api/proxy?method=findRoom&size=10

JSON Result:

Accounts

Get a list of accounts

Request
The following API URL can be used to read all accounts of type Administrator, Power User, Standard or Concurrent:
api/getScopeUsers?filter=[String]
Here [String] stands for a map in the form of a JSON string that filters the users to be found according to their validity date and whether they are deactivated or not. When specifying the timestamp, it is important to specify the number of milliseconds after "Epoch" (1970-01-01 00:00:00.000 GMT). The filter is optional: if it is omitted, only undeleted, non-deactivated users are returned.
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 contains a list of maps with the attributes of the accounts. The originally specified filter used for the request is returned in filter.
Example

GET URL:

api/getScopeUsers?filter={"validUntil":1511790000000,"deactivated":true}
Returns all users who have a validity date less than or equal to 2017-11-27 13:40 UTC and have been deactivated.

JSON Result:

Create an account

Request
The following API URL can be used to create a new account based on an account template from Scope:
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 is a map with the attributes of the new scope account.
Example

GET URL:

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

JSON Result:

Update an account

Request
An existing account can be updated with the following API URL:
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 is a map with the attributes of the updated scope account.
Example

GET URL:

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

JSON Result:

Query the LDAP database

Request
Any LDAP requests can be started via the scope server with the following API URL:
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 is the list maps with the requested attributes.
Example

Searches for all Rewoo users below the search base ou=people,dc=rewoo,dc=lan. The expected return values are displayName and uid.

GET URL:

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

JSON Result:

Create an LDAP related account

Anfrage
The following API URL can be used to create a new account based on an existing LDAP entry and an account template from Scope:
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 is a map with the attributes of the new scope account.
Example

GET URL:

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

JSON Result:

Read the LDAP configuration

Request
The LDAP configuration of the Scope server can be read out with the following API URL:
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 is a list of configuration parameters.
Example

GET URL:

api/getLdapUserConfig

JSON Result:

Key value store

Key value store: Query with a single key

Request
The following API URL can be used to read a value from the Scope key value store for external applications:
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 contains the requested value.
Example

GET URL:

api/getExternalAppValue?appId=myApp&key=country

JSON Result:

Key value store: Query with key prefix

Request
The following API URL can be used to read values with a key prefix from the Scope key value store for external applications:
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 contains a map with key-value pairs.
Example

GET URL:

api/getExternalAppValuesByPrefix?appId=myApp&keyPrefix=color

JSON Result:

Key value store: Write a value

Request
The following API URL can be used to write a value to the Scope key value store for external applications:
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: Delete all values

Request
The following API URL can be used to delete all values in the Scope key value store for a specific external application:
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

Add a webhook

Request
A webhook is a URL that is called up when an event occurs. Two events are currently supported:
  • cron - the scheduler has successfully executed the job with the specified name
  • value_change - values of forms of the specified type have been changed
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=Invoices&url=https://rewoo.de/test&login=test&password=test

JSON Result:

{
	"success": true,
	"event": "VALUE_CHANGE",
	"name": "Invoices" 		
}
Payload of the CRON event
If the scheduler has successfully executed a job, it sends the following payload in JSON format to all webhooks registered for this event:
{
	"event": "CRON",
	"jobName": "UpdateTODAYDependenciesJob"
}
Payload of the VALUE_CHANGE event
If form values have been changed, Scope sends the following payload in JSON format to all webhooks registered for this event:
{
	"event": "VALUE_CHANGE",
	"elementType": "Invoices",
	"elements": [3,8,12]
}

Remove webhook

Request
Webhooks can be cancelled again with the following call.
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=Invoices&url=https://rewoo.de/test

JSON Result:

Multiple operations

Execute multiple operations in one transaction

Request
The following API URL can be used to perform several of the operations listed above in one transaction to ensure that either all operations or none have been performed:
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 is a map with the name of the operation and the result.
Example

A new account is created and the globally unique ID assigned by Active Directory is also assigned to the scope-internal account ID in the key-value store so that the account can be mapped in Active Directory. The scope ID created in the first step can be referenced using the placeholder %<actionName>.<resultKey>%.

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: