AppSuite (Additional)

This is a detailed document for using the features of AppSuite.

Print Button

Webhook Specifications

Webhook is architecture which notifies to external services with HTTP on any events. On AppSuite, webhook is run with auto action when data have been added or updated.

Request

Request Method

POST

Content Type of Request

application/json

Request Body

The added/updated data and the app information are sent.
Key Value Description
app_id [App ID] This is the ID of the app.
data_id [Data ID] This is the ID of the added/updated data.
data [Data] This is the content of the added/updated data. Format of the data is same as record of the response of the data Reference API.
(For more information, please refer to AppSuite API Specifications > Data Reference API. )
* This JSON is not affected by access rights unlike the response of the data Reference API.
  • Part values which can not be refered by a user who add/update the data will be sent.
  • Part values of other applications which can not be refered by a user who add/update the data will be sent.
  • \permissions key will not be sent.
  • deny_write key will not be sent.
type [added | updated] This is the action to call the auto action: added on the data added, updated on the data updated.
app_name [App Name] This is the app name.
action_name [Title of Add/Update Action] This is the title of the add/update action.
access_token [Access Token] This is the "Access Token" of the add/update action. A empty value will be sent on empty.
url [Detail Screen URL] This is the URL to display the data with the default details screen.
* The URL is generated with access URL (internal network) of [Setup > URLs Settings].
external_url [Detail Screen URL for External Access] This is the URL to display the data with the default details screen.
* The URL is generated with access URL (external network) of [Setup > URLs Settings] .
* A empty value will be sent if the access URL (external network) is empty.
Example of Sent Content (Request Body)
{ "app_id": "59", "data_id": "141", "data": { "revision": { "val": "5" }, "Data ID": { "val": "141" }, "Date/Time Added": { "val": "2023-12-18T16:44:48" }, "Added By": { "val": { "users": { "item": [ { "id": "15", "Name": "John Smith", ... } ] } } }, "Date/Time Updated": { "val": "2023-12-19T13:42:48" }, "Updated By": { "val": { "users": { "item": [ { "id": "34", "Name": "John Smith", ... } ] } } }, "Name": { "val": "Keyboard" }, "Shipped": { "val": "2" }, "Stocked" { "val": "12", "type": "number" } }, "type": "updated", "app_name": "Stock App", "action_name": "Update the Stock", "access_token": "so84TkMOI470j127MA1Gp6PhIhNv+0SgS5508f8/SHo", "url": "https://192.168.1.1/cgi-bin/dneo/appsuite.exe?cmd=cdbbrowse&app_id=59#view_id=4&id=141", "external_url": "https://local.yourdomain/cgi-bin/dneo/appsuite.exe?cmd=cdbbrowse&app_id=59#view_id=4&id=141" }

About Error

When a error is occurred on webhook, the error information is saved to [App Settings > Operational Management > Error Log]. The following response need to be returned to save a error message such as some failure on the destination.

Example of Error Save
  • When the request have failed because the URL, the destination server or the network have any problem
  • When the response will not returned by 30 minutes
  • When the status code of the response is not "200"
  • When the status code of the response is "200" and the following response will be returned
    Key Value Description
    result ng Constant
    error_message [Error Message] This string will be saved to the error log.
    Example of the response
    { "result": "ng", "error_message": "The action have been stopped for invalid update data status." }

Trouble Shootings

If data of same application have been added/updated from Webhook destination with AppSuite API, infinite loop may occurred because auto actions will be run again. Infinite loop may be overload of the server and trigger any problem of management of desknet's NEO. This is guidance of prevention or solution of the problem.

Prevention of Infinite Loop

  • In case of the destination program runs data addition/update API, auto_action=off parameter should be specified. It prevents to run add/update actions with API.
    (For more information, please refer to AppSuite API Specifications > Data Addition API. )
  • You should tune settings about webhook in auto actions. If auto_action=off can not be specified because of system requirement, you should update "Run When" and "Narrow Down" to prevent infinite loop.

Solution of Infinite Loop

  • You should set "Status" in auto actions which can be run Webhook to "disable".
    * You need to find the app with the problem.
  • You should stop or restart the web server.

To Find the App with the Problem

If you can not find the app which infinite loop occurs with auto actions, you should find the app which runs data addition/update API repeatedly with [Setup > Log > Search Access Log].
* To use access log, desknet's NEO sheduler needs to be activated.

  1. Set "Logging for Create Add/Edit/Delete" to "Save" in [Setup > Log > Access Log Settings].
    * You need to wait about 10 minute because access log is collected at 10-minute intervals.

  2. Search access log with [Setup > Log > Search Access Log]. You should narrow down not to match log except for AppSuite.


  3. After the search results have been displayed, download CSV file from [Download] button and open the file.
    • The value of "Function Details" column is "insert_data" or "update_data"
    • The value of "Table Name, etc." column is "t000000000" (9 digits after "t")
    Rows which match both of above are logs of the data addition/update APIs. If mass addition/update log of save table exist, Infinite loop may occurred.


  4. Get the app ID from "Table Name, etc." (9 digits after "t"). Remove first "t" and last 3 digits from table name to get the app ID. (e.g. The app ID of "t000571000" is "571")

  5. Enter the following URL to your web browser to display the application management screen of the app.
    * You need to login with system administrator or AppSuite administrator.

    ・desknet's NEO URL: https://local.yourdomain/cgi-bin/dneo/dneo.cgi
    ・App ID: 571
    Example of above case
    https://local.yourdomain/cgi-bin/dneo/appsuite.cgi?cmd=cdbmsetappmanage&app_id=571

    If any "Webhook" action exist in [Auto Action > Add/Update Action], infinite loop may occur. You should check the action settings.