Try it NowFeaturesSource CodeDocs

Making raw calls to the API.

NetworkMaps provides the option of modifying your network diagrams using external scripts. This is done by establishing a set of websocket connections to the server and sending messages on these sessions (using JSON format). This is the same mechanism used by the GUI.
There are two channels where you can connect:
Normal Flow.
When using NetworkMaps API, you will usually follow these steps:
  1. Set up an authenticated session (if you already have an authenticated session, you can skip this step). Networkmaps uses a cookie to maintain sessions: (NetSessionSec for https or NetSessionNoSec for http).
    • When a new connection is established, networkmaps will create this cookie if it is not provided or the provided session is invalid. A session can be authenticated or not.
    • On websocket connection, the networkmaps user channel will send an initial message letting you know if your session is authenticated and by which user.
    • If the session is not authenticated, you will have to send an authentication message with username and password.
  2. Get uuid of the diagram to be edited/updated (or create a new diagram).
  3. Set up a connection to the diagram enpoint using the already authenticated session.
  4. Update the diagram.
The User Channel.
When a client connects to the use channel, he will receive an initial message telling him if the session used is initialized. This message has the following format:
{"m": "I", "d": <session_data> "session_id": <session_id>}
In general all messages sent or received on this channel will follow this format: {"m": "I", "d": <session_data>}. Where m defines the message type we are sending/receiving and d will be an object with the parameters of this message.
These are the messages types we can use:
The Diagram Channel.