nodum.io Docs

Welcome at the nodum Docs. You'll find comprehensive guides and documentation to help you start working with nodumApp as quickly as possible. Let's jump right in!

Get Started    Docs

Meta API

The nodum Meta API allows you to execute meta functions, normally exposed using the webapp at nodum.io.

If you want to take automation to the next level, eg. create folders, files or even projects programmatically, you can use the nodum Meta API. You can call Meta API's using HTTP Get / HTTP Post calls, where 3 HTTP headers are mandatory:

  • x-nodum-user
  • x-nodum-token
  • x-nodum-company

The x-nodum-user header should contain your e-mail address you would normally use to login at https://nodumapp.io. The x-nodum-token is IP-bound, and can be requested by sending a support ticket from within https://nodumapp.io. Please specify your IP address you want to bind to the token.

You can find you x-nodum-company ID by calling (HTTP Get):
https://nodumapp.io/rest/v1/Nodum_Api_LoginCompanyList(user,token)
... where user contains your nodumapp.io e-mail address and token contains the token received in your support ticket.

{% set t = 'john@doe.nl,abcd1234aaa' %}
{% set companyList = sabre.get('https://nodumapp.io/rest/v1/Nodum_Api_LoginCompanyList(' ~ t ~ ')') %}

{{ companyList.response.companies|pre }}

{# 
  As you can see at the tab "Response", to use the API
  for the company "MyCompany B.V.", your x-nodum-company 
  is: 26d0927e56f5f01815365849
#}
{
    "error": false,
    "message": "200 OK",
    "moment": 1519384508.5565,
    "response": {
        "companies": {
            "26d0927e56f5f01815365849": {
                "name": "MyCompany B.V.",
                "id": "26d0927e56f5f01815365849"
            }
        },
        "user": "john@doe.nl",
        "ip": "12.34.56.78"
    },
    "apipath": "Nodum_Api_LoginCompanyList",
    "code": "200"
}

Calling the API

If you are in possession of the 3 mandatory values (user, token, company), you can call the nodum Meta API using HTTP GET/POST requests. Let's say you want to fetch a list with details of all your projects. You can use the Nodum_listProjects() API for this.

Using Postman your request would look like this:

Using a nodum project, your request would look like this:

{% set projects = sabre.post(
    'https://nodumapp.io/rest/v1/Nodum_listProjects()',
    {},
    {
        'x-nodum-user' : 'john@doe.nl',
        'x-nodum-company' : '26d0927e56f5f01815365849',
        'x-nodum-token' : '5234f62f07e6a0109fc0e6e8e05c344ba89105e5'
    }
) %}

{{ projects.response|pre }}
{
    "error": false,
    "message": "200 OK",
    "moment": 1519384740.8354,
    "response": {
        "admin": {
            "nodum": {
                "clntnm": "NODUMAPP",
                "projnm": "NODUM ADMIN",
                "moment": "2016-12-07 11:37:02",
                "orgid": "26d0927e56f5f01815365849",
                "mail": "john@doe.nl",
                "company": "MyCompany B.V.",
                "contact": "5809249407af5015849267b9950927536e5d6f74e48f0181",
                "user": "John Doe"
            },
            "license": {
                "tryout": 0
            },
            "project": {
                "price": 25,
                "type": "prod"
            },
            "stats": {
                "version": "2.2.0",
                "size_mb": 51,
                "twig_cache": true,
                "mongo": {
                    "collections": 9,
                    "dataSize": 215,
                    "storageSize": 160,
                    "indexes": 4,
                    "objects": 607
                },
                "moment": {
                    "$date": 1519347604000,
                    "$unixtime": 1519347604,
                    "_datetime": "2018-02-23 02:00:04"
                }
            },
            "__path": "myproject",
            "__href": "myproject.nodum.io",
            "__prot": "https",
            "__vers": "2.2.0"
        }
    },
    "apipath": "Nodum_listProjects",
    "code": "200"
}

Available Meta API's

Common

  • /rest/v1/Nodum_listProjects( )
  • /rest/v1/Nodum_listDevices( )
  • /rest/v1/Nodum_copyFile( project, folder, filename, folderTo, filenameTo )
  • /rest/v1/Nodum_copyFolder( project, folder, folderTo )
  • /rest/v1/Nodum_createFile( project, folder, filename )
    Note: Filename without .twig!
  • /rest/v1/Nodum_createFolder( project, folder, linkToProject, linkToFolder )
  • /rest/v1/Nodum_createProject( projectKey, projectName, clientName )
  • /rest/v1/Nodum_getFileTree( project )
  • /rest/v1/Nodum_renameFile( project, folder, filename, folderTo, filenameTo )
  • /rest/v1/Nodum_removeFolder( project, folder )
  • /rest/v1/Nodum_removeFile( project, folder, filename, extension=twig )
  • /rest/v1/Nodum_getFolders( project )
  • /rest/v1/Nodum_renameFolder( project, folder, folderTo )
  • /rest/v1/Nodum_unlinkAndCopyFolder( project, folder )

Domains

  • /rest/v1/Nodum_Account_Domain( domain, project )

Tasks

  • /rest/v1/Nodum_Task_startJob( project, jobName, startNow=0 )
  • /rest/v1/Nodum_Task_createFolder( project, jobName )
  • /rest/v1/Nodum_Task_removeTask( project, jobName )
  • /rest/v1/Nodum_Task_ListTasks( taskNameFilter=ALL, project )
  • /rest/v1/Nodum_Task_getStats( project, jobName, withLogs=1 )
  • /rest/v1/Nodum_Task_getLog( project, jobName, logFile )
    Note: logFile: the 'abcd.log' filename from getStats
  • /rest/v1/Nodum_Task_killProcess( project, jobName, process )
    Note: process: the PID from getStats

Media

  • /rest/v1/Nodum_Media_setFolderPublic( directory, public=1 )