|
|
|
@ -34,11 +34,21 @@ sudo python setup.py install
|
|
|
|
|
**Get account details**
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
from sipcentric import Sipcentric
|
|
|
|
|
from sipcentric import API, Partner, Customer
|
|
|
|
|
|
|
|
|
|
api = Sipcentric(username="myusername", password="mypassword")
|
|
|
|
|
api = API(username="myusername", password="mypassword")
|
|
|
|
|
|
|
|
|
|
print api.account.get()
|
|
|
|
|
# Simwood Partners can interact with Sipcentric and create new Customers
|
|
|
|
|
partner = Partner(api)
|
|
|
|
|
for customer in partner.customers():
|
|
|
|
|
print(customer.data['name'])
|
|
|
|
|
newcust = Customer(api)
|
|
|
|
|
newcust.create(company="Acme Ltd", firstName="Hayes", lastName="Murphy", email="hayes@example.com",
|
|
|
|
|
address1="24 Acacia Avenue", city="", 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**
|
|
|
|
@ -61,39 +71,6 @@ stream.register(type='smsreceived', callback=smsHandler)
|
|
|
|
|
stream.connect()
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Reference
|
|
|
|
|
|
|
|
|
|
- sipcentric.Sipcentric(username, password, base='https://pbx.sipcentric.com/api/v1', customer='me')
|
|
|
|
|
- account
|
|
|
|
|
- get()
|
|
|
|
|
- callBundles
|
|
|
|
|
- get()
|
|
|
|
|
- recordings
|
|
|
|
|
- get()
|
|
|
|
|
- phoneBook
|
|
|
|
|
- get()
|
|
|
|
|
- timeIntervals
|
|
|
|
|
- get()
|
|
|
|
|
- endpoints
|
|
|
|
|
- get()
|
|
|
|
|
- phoneNumbers
|
|
|
|
|
- get()
|
|
|
|
|
- sms
|
|
|
|
|
- get()
|
|
|
|
|
- post(to, _from, body)
|
|
|
|
|
- creditStatus
|
|
|
|
|
- get()
|
|
|
|
|
- calls
|
|
|
|
|
- get()
|
|
|
|
|
- sounds
|
|
|
|
|
- get()
|
|
|
|
|
- outgoingCallerIds
|
|
|
|
|
- get()
|
|
|
|
|
- Stream
|
|
|
|
|
- register(type, callback)
|
|
|
|
|
- connect()
|
|
|
|
|
- disconnect()
|
|
|
|
|
|
|
|
|
|
## History
|
|
|
|
|
|
|
|
|
|
This project was forked from Nimvelo's original project (for Python 2.7)
|
|
|
|
|