2022-01-22 18:44:30 +00:00
2022-01-13 12:59:19 +00:00
2022-01-13 12:59:19 +00:00
2022-01-19 08:48:51 +00:00
2022-01-26 12:14:10 +00:00
2022-01-13 11:51:53 +00:00

Simwood Partner Python Client

A modern Python client library for Sipcentric (Simwood Partner, formerly Nimvelo) API.

from sipcentric import Sipcentric
api = Sipcentric(username="myusername", password="mypassword")
print api.sms.post(_from="0123", to="03301201200", body="Hello World!")

Install

Best method

sudo pip install sipcentric

You may need to install simplejson if you don't have it already.

Manual method

git clone git@github.com:faelix/sipcentric.git && cd sipcentric
sudo python setup.py install

Getting started

Examples

Get account details

from sipcentric import API, Partner, Customer, ACCOUNTTYPE_BUSINESS

api = API(username="myusername", password="mypassword")

# Simwood Partners can interact with Sipcentric and create new Customers
partner = Partner(api)
for customer in partner.customers():
    print(customer.data['company'])
newcust = Customer(api)
newcust.create(accountType=ACCOUNTTYPE_BUSINESS,
               company="Acme Ltd", firstName="Hayes", lastName="Murphy", email="hayes@example.com",
               address1="24 Acacia Avenue", city="Newton", postcode="FX5 7HQ", telephone="03069990000")

# if your API credentials are for a Customer account:
customer = Customer(api, "me")
print(customer.data['company'])

Connect to the streaming api

from sipcentric import Sipcentric

api = Sipcentric(username="myusername", password="mypassword")
stream = api.Stream

def callHandler(call):
  print 'Incoming call from ' + call['callerIdName'] + ' (' + call['callerIdNumber'] + ')'

def smsHandler(sms):
  print sms['excerpt'] + ' from: ' + sms['from']

stream.register(type='incomingcall', callback=callHandler)
stream.register(type='smsreceived', callback=smsHandler)

stream.connect()

History

This project was forked from Nimvelo's original project (for Python 2.7) python-client. The name was changed to sipcentric after discussion with the development team at Simwood.

Description
Modern Python client library for the Simwood Partner (Nimvelo/Sipcentric) API — https://developer.simwood.com/docs/direct/api/v1/
https://github.com/faelix/sipcentric
Readme 810 KiB
Languages
Python 100%