Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
titleIn this article

Table of Contents


Panel
borderColor#ccffcc
bgColor#ccffcc
borderWidth2px

More Information

This page contains information about Provisioning API as a section of the user interface. For the documentation about Provisioning API as a concept and its usage, please refer to ProvisioningAPI article.

Section overview

The following section allows configuring and monitoring of hooks for Provisioning API

Provisioning API provides a mechanism for real-time integration with 3rd party systems, including softswitches, gateways, and CRM systems. It calls calls pre-defined handlers on an the occurrence of specific events in the system. The handlers are allowed to modify data, forbid or allow the action or simply process given event. For detailed information about Provisioning API functionality, go to the APIs section of our User Guide.

To configure handlers and check their call log, go to the Integration > Provisioning API.

Image Modified

ColumnDescription
IDHandler's identification number
Priority

Priority of handlers execution

NameHandler's title
Event

Description of the handler event

Handler

Category of the handler that is used and location. There are two types of handlers that can be used: 

  • HTTP scripts, called via POST requests (used in most cases)
  • Local server scripts, called locally on the server (used in very specific cases)

...

To start with provisioning, you need to create a handler manually. Click the New Handler button and specify respective parameters in the appeared pop-up window:

...

Field Description

Name

Specify a particular title for a handler
Event

Specify a handler event from the following list:

Clients

  • create
  • update
  • delete
  • archive
  • custom fields update
  • balance became >=0
  • balance became <=0
Accounts
  • create
  • update
  • delete
Subscriptions
  • assign
  • activate
  • deactivate
  • renew
  • close 
Import
  • import process failed
  • import process success

an event to be handled

Status

Choose the state of the handler:

  • enabled - select it to make a handler active;
  • disabled - select it to unable a handler;
  • archived - select it to archive a handler.

Priority

Establish an order of handler performing.
Note: The handler with 1 priority will precede all other handlers in orderLower values have higher priority.


Image Removed Best practice example

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

Open the Provisioning section and start creating a handler.

Specify the name, type, and status.
  • In the Event field, select Clients Create event from the drop-down list.
  • In the Task field, indicate HTTPS type and define the URL for the handler, for example, my-domain.org/api.
  • Click Apply.
  • Find an example of the http://handler below:

    Panel
    borderColor#ccffcc
    bgColor#ccffcc
    borderWidth2px
    borderStylesolid
    Code Block
    languagepy
    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()
    Panel
    borderColor#ffffb3
    bgColor#ffffb3
    borderWidth2px

    (warning)   Attention

    To put a handler into action, you need to wait for about 5 minutes till the next execution of the Cache Manager service.

    ...

    You can access the details about handler execution in this tab. For more details, check out a related article: Execution Logs

    ...

    borderColor#FFBABA
    bgColor#FFBABA
    borderWidth2px
    borderStylesolid

    Image Removed Warning

    ...