Mitel 3300 REST API

From Michael's Information Zone
Jump to navigation Jump to search

Example

[1]

#!/usr/bin/python3

from requests_oauthlib import OAuth1Session as session

##Consumer information
consumer_name = 'sas_usp'
shared_secret = '...'
token_id = '...'
token_secret = '...'

##URLs
baseurl = 'https://mca.tld/mslrest'
requesturl=baseurl + '/initiate'
authurl=baseurl + '/authorize'
accesstokenurl=baseurl + '/token'
pingurl=baseurl + '/ping'

##initiate
oauth = session(consumer_name, client_secret=shared_secret, resource_owner_key=token_id, resource_owner_secret=token_secret)

##Test connection
test = oauth.get(pingurl)
print(test.text)