Snippets

Team Zoom Node.js examples

Created by Terence Foxcroft

File package.json Added

  • Ignore whitespace
  • Hide word diff
+{
+  "name": "zoomconnect-api-nodejs-examples",
+  "version": "1.0.0",
+  "description": "Zoom Connect REST API examples for Node.js",
+  "main": "run.js",
+  "dependencies": {
+    "node-fetch": "^2.3.0"
+  }
+}

File zoomconnect-api-nodejs-examples-send-using-json.js Added

  • Ignore whitespace
  • Hide word diff
+let fetch = require('node-fetch')
+
+var emailAddress = 'YOUR_EMAIL_ADDRESS'
+var restApiToken = 'YOUR-API-TOKEN'
+var auth = 'Basic ' + Buffer.from(emailAddress + ':' + restApiToken).toString('base64')
+
+fetch('https://www.zoomconnect.com/app/api/rest/v1/sms/send.json', {
+    method: 'POST',
+    headers: {
+        'Accept': 'application/json',
+        'Content-Type': 'application/json',
+        'Authorization': auth
+      },
+      body: JSON.stringify({
+          recipientNumber: '27821234567',
+          message: 'Test message'
+      })
+}).then(response => {
+    if (response.status == 200) {
+        // sent successfully
+        response.json().then(result => {
+            console.log('Response: ' + result)
+        })
+    } else {
+        // not sent successfully
+        console.log('Request failed with response code: ' + response.status)
+    }
+}).catch(err => {
+    console.log(err)
+})
HTTPS SSH

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