Office API

POST 

  • The POST method lets you create a new office. 
  • A successful create returns response code 200 and the newly created office in JSON format (see Item API).

POST projecten.viadesk.com/api/office.json
form field “id” // the id of the event (required for editing existing offices)
form field “name” // name of event (required for new events)
form field “body” // description of the event (optional)
form field “category” // category of the event (optional)

form field "officetemplate" // the id of the template to base the office on (optional)
file “featuredimage” // adding a cover image (optional)

GET
The GET method returns the complete tree of all folders and menu items in the office.
The start page is not a real folder, but a stub to make a “Startpage” link visible in the menu.


In the UI, the startpage displays all direct content Items that have the office as parent.

GET projecten.viadesk.com/api/office.json?id=407102…
 
response body:
{
    "id": "407102-6f6666696365",
    "kind": "office", // this is an “office”
    "name": "Mobile Development",
    "created": "2011-04-08T15:06:28CEST"
    "modified": "2011-04-08T15:06:28CEST",
    "canWrite": true, // user has “write” permission on this item
    "canAddChildren": true, // user has “add” permission on this item
    "contentCount": 15, // the number of documents, discussions, etc
    "folderCount": 3, // the number of sub-folders (absent if zero)
    "children": [
        {
            "id": "407127-737461727470616765"
            "kind": "startpage", // special menu item
            "name": "Startpagina",
        },
        {
            "id": "407137-666f6c646572"
            "kind": "folder",
            "name": "Android",
            "folderCount": 1,
            "children": [
                {
                    "kind": "folder",
                    "name": "Screenshots Android - mei 2012",
                    "id": "434987-666f6c646572",
                    "contentCount": 4
                }
            ]
        }
    ]
}