menus

Returns all the menus.

JS
CR.api('site.menus.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.menus.find

request

{
  "language" : "en" // language ( ISO code ) of the texts to return - string(2)
}

response

{
  "status" : "ok",
  "menus" : [ {
    "id" : 3, // identifier - int(1…10)
    "items" : [ { // items
      "name" : { // name - string(2) -> string(0…40)
        "en" : "About us",
        "it" : "Chi siamo"
      },
      "description" : { // description - string(2) -> string(0…40)
        "en" : "View your orders and your invoices",
        "it" : "Vedi i tuoi ordini e le tue fatture"
      },
      "isTitle" : false, // indicates if it is a title - bool
      "link" : { // link, only one field can be present at the same time (can be null)
        "page" : "23", // page (id or file name) - string(1…30)
        "path" : "blog.html", // path inside the site - string(1…250)
        "url" : "http://site/page.html" // url - string(1…250)
      },
      "showTo" : "All", // indicates if it has to be shown to all, anonymous or logged in users, can be "All", "Anonymous" or "LoggedIn" - string
      "openNewWindow" : false, // indicates if the link must open a new window - bool
      "openAsModal" : false // indicates if the link must open a modal window - bool
    }, … ]
  }, … ]
}

Returns a menu given its identifier.

JS
CR.api('site.menus.get', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.menus.get

request

{
  "id" : 3, // identifier of the menu (required) - int(1…10)
  "language" : "en" // language ( ISO code ) of the texts to return - string(2)
}

response

{
  "status" : "ok",
  "menu" : {
    "id" : 3, // identifier - int(1…10)
    "items" : [ { // items
      "name" : { // name - string(2) -> string(0…40)
        "en" : "About us",
        "it" : "Chi siamo"
      },
      "description" : { // description - string(2) -> string(0…40)
        "en" : "View your orders and your invoices",
        "it" : "Vedi i tuoi ordini e le tue fatture"
      },
      "isTitle" : false, // indicates if it is a title - bool
      "link" : { // link, only one field can be present at the same time (can be null)
        "page" : "23", // page (id or file name) - string(1…30)
        "path" : "blog.html", // path inside the site - string(1…250)
        "url" : "http://site/page.html" // url - string(1…250)
      },
      "showTo" : "All", // indicates if it has to be shown to all, anonymous or logged in users, can be "All", "Anonymous" or "LoggedIn" - string
      "openNewWindow" : false, // indicates if the link must open a new window - bool
      "openAsModal" : false // indicates if the link must open a modal window - bool
    }, … ]
  }
}

Updates a menu. Any fields left out of the request will remain unchanged.

JS
CR.api('site.menus.update', request, function(response) { … });
HTTP
POST /open2b/api/v3/site.menus.update

request

{
  "id" : 3, // identifier of the menu (required) - int(1…10)
  "menu" : { // menu's fields to update (required)
    "items" : [ { // items (required)
      "name" : { // name - string(2) -> string(0…40)
        "en" : "Orders and Invoices",
        "it" : "Ordini e Fatture"
      },
      "description" : { // description - string(2) -> string(0…40)
        "en" : "View your orders and your invoices",
        "it" : "Vedi i tuoi ordini e le tue fatture"
      },
      "isTitle" : false, // indicates if it is a title - bool
      "link" : { // link, only one field can be present at the same time (required)
        "page" : "23", // page (id or file name) - string(1…30)
        "path" : "blog.html", // path inside the site - string(1…250)
        "url" : "http://site/page.html" // url - string(1…250)
      },
      "showTo" : "All", // indicates if it has to be shown to all, anonymous or logged in users, can be "All", "Anonymous" or "LoggedIn" - string
      "openNewWindow" : false, // indicates if the link must open a new window - bool
      "openAsModal" : false // indicates if the link must open a modal window - bool
    }, … ]
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
items Invalid Link must contain only one field
items Invalid Page must be the identifier or the file name of the page