Versions Compared

Key

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

...


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

Prior to that, VCS Core API and  VCS Core API and Management API provide utilities needed to receive requests from external systems. Now, you can configure VCS billing platform to send requests to your 3rd party system.

...

Panel
borderColor#ccffcc
bgColor#ccffcc
borderWidth2px
borderStylesolid
Tip

The full list of Provisioning API parameters matches with CoreAPI and they are available upon an individual request of your current clients.

...


Panel
borderColor#ccffcc
bgColor#ccffcc
borderWidth2px
borderStylesolid
Best practice example

Here there is an example how to apply the script handler.

Open the Provisioning section and create a handler.
  • Specify the name, type, and status.
  • In Event field select Before and Clients Create event from the drop-down list.
  • In Task field indicate script type and determine the location of the script, for example: /provisioning/script.py.
  • Click Apply.
  • We have the next script (see below) with the following location: /provisioning/script.py.

    Code Block
    languagepy
    #!/usr/bin/env python2.7
    import sys 
    import json 
    input = '\n'.join(sys.stdin.readlines()) 
     
    data = json.loads(input) 
    data['name'] = data['name'] + "testprefix" 
     
    print json.dumps(data)

    As a result, this handler will add the prefix to the name of the client after creation. Here there is an example based on http://handler usage.

    2. Open the Provisioning section and start to create a handler.

      1. Specify the name, type, and status.
      2. In Event field select After and Clients Create event from the drop-down list.
      3. In Task field indicate http:// type and determine the port and method, for example: 120.0.0.1:5000/api.
      4. Click Apply.

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

    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()


     

    ...