Snippets

Team Zoom Python - send using json

Created by Terence Foxcroft last modified
# Post request to send a single message using json
# This script makes use of the Requests Library: http://docs.python-requests.org/en/latest/

import json
import requests

email_address = 'YOUR_EMAIL_ADDRESS'
rest_api_token = 'YOUR-API-TOKEN'
base_url = 'https://www.zoomconnect.com/app/api/rest/v1/'

data = {}
data['message'] = 'Test message'
data['recipientNumber'] = '+27821234567'
json_data = json.dumps(data)

response = requests.post(base_url + 'sms/send.json', 
    data=json_data,
    headers={"Content-Type": "application/json"},
    auth=(email_address, rest_api_token))

if (response.ok):
    print 'Response: ' + str(response.json())
else:
    print 'Request failed with response code' + str(response.status_code)

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.