Mitel 3300 REST API

From Michael's Information Zone
Revision as of 09:10, 25 June 2021 by Michael.mast (talk | contribs) (Created page with "==Example== <ref>http://mitelforums.com/forum/index.php?topic=13874.0</ref> <pre> #!/usr/bin/python3 from requests_oauthlib import OAuth1Session as session ##Consumer inform...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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)