Create a user specific navigation

Incompatible API changes

From version 1.9 to 2.0 of the Navigation Menu Editor plugin we made some incompatible changes on the REST API. Therefore we introduced a new 2.0 endpoint to the REST API. Please have a look at the following documentation.

JavaScript API

In some cases it may be desirable to render the menu structure yourself. We have built a JavaScript component that gets the menu structure for the current user in JSON format.

/**
 * Get the JSON representation for the menu of the current user.
 * @param callback Function to process JSON, e.g. processJSON(Object menuJson){ ... }
 */
SeibertMedia.MenuEditor.MenuBuilder.buildJsonMenu(function callback)

Navigation Menu Editor REST API

ResourceDescriptionPermission
GET menueditor/2.0/menuReturns the navigation structure in JSON formatEveryone
POST menueditor/2.0/menuCreates a new menu and publishes itAdmins, Editors
GET menueditor/2.0/menu/draft/{key}Returns a draft in JSON formatAdmins, Editors
POST menueditor/2.0/menu/draft Creates a new draft (saves the navigation structure without publishing it)Admins, Editors

GET menueditor/2.0/menu/unfiltered

Returns the latest saved unfiltered navigation structure in JSON format.
Admins, Editors
GET menueditor/1.0/menu/backup/{backupKey}Returns a backup of the navigation structure in JSON format.Admins, Editors
DELETE menueditor/1.0/lockservice/unlockEnds the locked session of the current menu editor.
Replaced by DELETE menueditor/2.0/lock in 2.0
Everyone
DELETE menueditor/2.0/lockReplaces menueditor/1.0/lockservice/unlockEveryone
ResourceDescriptionPermission
GET menueditor/2.0/configurationRetrieve the list of fields that are configured for filteringEveryone
GET linchpin/2.0/fieldsReturns the possible user fieldsEveryone
GET linchpin/2.0/cupinstalledChecks Custom User Profile Plugin is installedEveryone
ResourceDescriptionPermission
GET menueditor/2.0/permissions/checkReturns true or false if the current logged in user has permission to edit the navigation structureEveryone

GET menueditor/2.0/permissions

Get a list of all permitted users and groupsAdmin
POST menueditor/2.0/permissionsGrant edit permission to a user or groupAdmin
DELETE menueditor/2.0/permissions/{name}Revoke edit permission of a user or groupAdmin

GET linchpin/2.0/profile

Get the user profile data of a userEveryone

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/menu

filter0

Specifies the value for the first set up user field.
e.g. If you have set up the Confluence locale as your first user field, you might set filter0=en_GB to get the navigation structure for an english user.

filter1Same as above. Filter value for the second set up user field.
filter2Same as above. Filter value for the third set up user field.
{
   "entries":[
      {
         "title":"Item 1",
         "entityID":"852021",
         "type":"internal-page-link",
         "link":"",
         "targetBlank":false,
         "filters":[ 
            "",
            "",
            ""
         ],
         "menu":{
            "entries":[
               {
                  "entityID":"",
                  "title":"Item 1.1",
                  "link":"http://www.example.com",
                  "type":"external-link",
                  "targetBlank":false,
                  "filters":[ 
                    "",
                    "",
                    ""
                  ]
               },
               {
                  "entityID":"",
                  "title":"Item 1.2",
                  "link":"http://www.example.com",
                  "type":"external-link",
                  "targetBlank":false,
                  "filters":[ 
                    "",
                    "",
                    ""
                  ]
               },
               {
                  "entityID":"SPACE",
                  "title":"Item 1.3",
                  "link":"",
                  "type":"internal-space-link",
                  "targetBlank":false,
                  "filters":[ 
                    "",
                    "",
                    ""
                  ]
               },
               {
                  "entityID":"",
                  "title":"Category 1.4 (with subcategory)",
                  "link":"",
                  "type":"category",
                  "targetBlank":false,
                  "filters":[ 
                    "",
                    "",
                    ""
                  ]
                  "menu":{
                     "entries":[
                        {
                           "entityID":"",
                           "title":"Category 1.4.1",
                           "link":"",
                           "type":"category",
                           "targetBlank":false,
                           "filters":[ 
                             "",
                             "",
                             ""
                           ]
                        }
                     ]
                  }
               }
            ]
         }
      }
   ]
}
keydescription
entityIDID of the Confluence Entity (Page ID or SpaceKey)
title 
linkexternal URL if entry is an external link
type"category", "separator", "internal-space-link", "internal-page-link", "dashboard-link", "external-link"
targetBlankif "true", the link opens in a new tab/window
filters 

POST menueditor/2.0/menu 

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/menu

Parameters: -

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/menu/draft

Parameters: -

POST menueditor/2.0/menu/draft

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/menu/draft

Parameters: -

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/menu/unfiltered

-

Have a look at GET menueditor/2.0/menu

Resource URL: <HOST><CONTEXT>/rest/menueditor/1.0/menu/unfiltered

-

Have a look at GET menueditor/2.0/menu

Resource URL: <HOST><CONTEXT>/rest/menueditor/1.0/lockservice/unlock

-

null

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/lock

-

null

 

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/configuration

-

[
	"confluence.locale",
	"cup.location-5",
	"cup.department-7"
]

Resource URL: <HOST><CONTEXT>/rest/linchpin/2.0/fields

-

[
  {
    "userFieldBK": "confluence.name",
    "labelPropertyKey": "Name"
  },
  {
    "userFieldBK": "confluence.email",
    "labelPropertyKey": "Email"
  },
  {
    "userFieldBK": "confluence.fullname",
    "labelPropertyKey": "Fullname"
  },
  {
    "userFieldBK": "confluence.locale",
    "labelPropertyKey": "Locale"
  }
]

Resource URL: <HOST><CONTEXT>/rest/linchpin/2.0/cupinstalled

-

false

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/permissions/check

-

{
    "permitted":true
}

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/permissions

-

{
  "permissions": [
    {
      "name": "editor",
      "type": "user",
      "fullname": "Eddi Editor"
    },
	{
	 "name": "Editors",
	 "type": "group"
	}
  ]
}

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/permissions

nameName of the user or group that should be permitted to edit the menu
{
  "permissions": [
    {
      "name": "editor",
      "type": "user",
      "fullname": "Eddi Editor"
    },
	{
	 "name": "Editors",
	 "type": "group"
	}
  ]
}

Resource URL: <HOST><CONTEXT>/rest/menueditor/2.0/permissions/{name}

nameName of the user or group that should be removed
{
  "permissions": [
    {
      "name": "editor",
      "type": "user",
      "fullname": "Eddi Editor"
    },
	{
	 "name": "Editors",
	 "type": "group"
	}
  ]
}

Resource URL: <HOST><CONTEXT>/rest/linchpin/2.0/profile

{
  "confluence.fullname": "Admin Istrator",
  "confluence.name": "admin",
  "confluence.locale": "de_DE",
  "confluence.email": "admin@example.com"
}
  • No labels

This content was last updated on 09/27/2017.

This content hasn't been updated in a while. That doesn't have to be a problem. Some of our pages live for years without becoming obsolete. Please click this link if you want us to update this page. Old content can be incorrect, misleading or outdated. Please get in contact with us via a form on this page, our live chat or via email with content@seibert.group if you are in doubt, have a question, suggestion, or want changes from us.