Top Menu Entry

TopMenu is an API for registering entry in the Nextcloud Top Menu for ExApps. AppAPI takes responsibility to register TopMenu and proxy all requests to the ExApp.

Register Menu Entry

OCS endpoint: POST /apps/app_api/api/v1/ui/top-menu

Params

Complete list of params (including optional):

{
    "name": "unique_name_of_top_menu",
    "displayName": "Display name",
    "icon": "img/icon.svg",
    "adminRequired": "0 or 1",
}

Optional params

  • icon - Url to icon, default: null

  • adminRequired - Value indicating whether the entry should be visible to all or only to admins

Unregister Menu Entry

OCS endpoint: DELETE /apps/app_api/api/v1/ui/top-menu

Params

To unregister TopMenu, just provide the name of registered TopMenu:

{
    "name": "unique_name_of_top_menu"
}

Set Initial state

OCS endpoint: POST /apps/app_api/api/v1/ui/initial-state

Params

{
    "type": "top_menu",
    "name": "unique_name_of_top_menu",
    "key": "key_name",
    "value": "array with value(s)",
}

Remove Initial state

OCS endpoint: DELETE /apps/app_api/api/v1/ui/initial-state

Params

{
    "type": "top_menu",
    "name": "unique_name_of_top_menu",
    "key": "key_name",
}

Add script

OCS endpoint: POST /apps/app_api/api/v1/ui/script

Params

{
    "type": "top_menu",
    "name": "unique_name_of_script",
    "path": "Url to script, e.g.: js/ui_example-main",
    "afterAppId": "optional value",
}

Remove script

OCS endpoint: DELETE /apps/app_api/api/v1/ui/script

Params

{
    "type": "top_menu",
    "name": "unique_name_of_script",
    "path": "Url to script",
}

Add style

OCS endpoint: POST /apps/app_api/api/v1/ui/style

Params

{
    "type": "top_menu",
    "name": "unique_name_of_style",
    "path": "Url to style, e.g.: css/my-style",
}

Remove style

OCS endpoint: DELETE /apps/app_api/api/v1/ui/style

Params

{
    "type": "top_menu",
    "name": "unique_name_of_style",
    "path": "Url to style",
}