Actions

Zenitel Link (Zenitel Connect Pro)

From Zenitel Wiki

ZCP IconPlatf.PNG

Introduction

WAMP is the native protocol for Zenitel Connect Pro. WAMP provides two application messaging patterns in one unified protocol:

  • routed Remote Procedure Calls
  • Publish & Subscribe

WAMP RPC's can also be accessed via an HTTP front end, which has been added to provide a RESTfull interface style in line with the OpenAPI (Swagger) specification. WAMP and the REST API can both be used to integrate Zenitel Connect Pro to 3rd party systems. These API's are collectively called Zenitel Link.

Licensing

Zenitel Link is a licensed feature. The license has item number 1002720900. A single license is required to activate Zenitel Link.

OpenAPI

The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. This allows for understanding and interacting with the Zenitel Connect Pro Platform with a minimal amount of implementation logic. The page can be reached through http://IP_ADDRESS_OF_ZENITEL_CONNECT/openapi

WAMP

As WAMP is the native protocol, all capabilities are available via WAMP. A major advantage of using WAMP is that it allows to subscribe to events, for instance status changes of devices.

Mixing WAMP and REST

It is possible to combine the REST API and WAMP in the same integration module. WAMP can then be used for status event subscription, while the REST API can be used for all other interactions.

Relation between WAMP RPC's and REST calls

  • The HTTP path is translated to a WAMP RPC Procedure URI.
    • /api/rpc/{rpc} is translated to WAMP URI "com.zenitel.{rpc}". Any '/' in {rpc} is translated to '.'.
    • For POST or PUT to /api/rpc/* the suffix ".post" or ".put" is appended to the WAMP RPC Procedure URI
  • An HTTP POST/PUT body must be a JSON value, and is translated to the first element in a WAMP CALL.Arguments message field.
  • WAMP RESULT is translated to HTTP 200 OK. If RESULT.Arguments is non-empty, the first element is returned as the response body.
  • WAMP ERROR CALL is translated to the appropriate HTTP error statuses.

HTTP POST

POST /api/rpc/{rpc}
{ "param1": "val1", "param2": "val2"}
translates to:
WAMP [CALL, <id>, {}, "com.zenitel.{rpc}.post", [{ "param1": "val1", "param2": "val2"}], ]

WAMP RESULT

WAMP RESULT is translated to a 200 OK HTTP response. The first element of YIELD.Arguments goes to the HTTP response body.
WAMP [RESULT, <id>, {}, [{ "param1": val1, "param2": "val2"}] ]
translates to:
HTTP 200 OK
{ "param1": val1, "param2": "val2"}

HTTP GET

GET /api/rpc/{rpc}
translates to:
WAMP [CALL, <id>, {}, "com.zenitel.{rpc}" ]

Publishing events

It is possible to publish events on the WAMP router located in Zenitel Connect Pro. This could be useful if a system integrated with Zenitel Connect Pro needs to send events which it generates itself to another system which is integrated with Zenitel Connect Pro. To use this capability, publish events to a topic which starts with com.zenitel.public. Other systems can subscribe to such events.