This documentation relates to an earlier version of JeraSoft VCS.
View User Guide 3.26 or visit our current documentation home page.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

In this article

The Provisioning API provides a mechanism for real-time integration with 3rd party systems, including softswitches, gateways, and CRM systems. The mechanism calls pre-defined handlers on the occurrence of specific events in the system.

While Core API and Management API sub-systems answer requests, Provisioning API pushes data as soon as an event occurs. For example, you can monitor the client's balance status via this functionality. Thus, when the client's balance is below zero, you can configure the system to send a notification to an external system to avoid any disruptions to your organization's current processes.

Handlers

A typical handler should be configured as is HTTPS or HTTP with an URL of the script, which will get HTTP POST requests about each event occurrence.

Please avoid using the Script type of handlers, they are designed for internal usage within the system.

Best practice example

There is an example based on https://hostname/handler-endpoint usage.

Open the Provisioning section and start creating a handler.

  1. Specify the name, type, and status.
  2. In the Event field, select Clients Create event from the drop-down list.
  3. In the Task field, indicate HTTPS type and define the URL for the handler, for example, my-domain.org/api.
  4. Click Apply.

Find an example of the http://handler below:

from flask import Flask, request
import json
app = Flask(__name__)
@app.route("/api", methods=['GET', 'POST'])
def api():
    data = json.loads(request.data)
    return json.dumps(data)
if __name__ == "__main__":
    app.run()

Event Payload

Structure

Within notification, the handler will be called with a JSON-formatted data payload. The payload has the following structure:

  • event
    • dt - the date-time of the event in the ISO8601 format;
    • events_id - ID of the event occurred (helpful, when multiple events are handled by the same handler);
    • object_id - the entity, to which the event happened;
  • data - data related to the specific event (check Payload Samples below)


Supported Events

Please note that some Payload Samples below contain reduced payload as they fully replicate the data structures within CoreAPI. Please refer to the respective documentation within the system interface in the Integration/CoreAPI Docs section for full format of the structure.

Event IDPayload Sample

Clients Management

clients.create

The client has been created

{
  "event": {
    "dt""2000-01-01T00:00:00+00:00",
    "events_id""clients.create",
    "object_id"12
  },
  "data": {
    "id"12,        
    "name""My name",
    "companies_id": 3,
    ...

  }
}

clients.update

The client's details have been updated

{
  "event": {
    "dt""2000-01-01T00:00:00+00:00",
    "events_id""clients.update",
    "object_id"12
  },
  "data": {
    "id"12,        
    "name""My changed name"
  }
}

clients.archive

The client has been archived

{
  "event": {
    "dt""2000-01-01T00:00:00+00:00",
    "events_id""clients.archive",
    "object_id"12
  },
  "data": {}
}

clients.delete

The client has been completely deleted

Not to be confused with archived

{
  "event": {
    "dt""2000-01-01T00:00:00+00:00",
    "events_id""clients.delete",
    "object_id"12
  },
  "data": {}
}

clients.balance_zero

The client has been 


clients.alance_notzero

The client has been 


clients.custom_fields.update

The client has been 


Accounts Management

clients.accounts.create

The client has been created


clients.accounts.update

The client has been created


clients.accounts.delete

The client has been created


Subscriptions Management

clients.subscriptions.assign

The client has been created


clients.subscriptions.activate

The client has been created


clients.subscriptions.deactivate

The client has been created


clients.subscriptions.renew

The client has been created


clients.subscriptions.close

The client has been created


Email Rates Manager Management

email_rates_manager.import

The client has been created


email_rates_manager.rate_tables_no_match

The client has been created


email_rates_manager.no_attachments

The client has been created


email_rates_manager.file_processing_error

The client has been created


Import Manager Management

importd.process_success

The client has been created


importd.process_failed

The client has been created


Tip

  • For more information about configuring and monitoring the hooks for Provisioning API, visit our respective article User Guide > System > Provisioning API.
  • If you need to process some of the actions that are not listed here, contact our support for a feature request. 
  • No labels