Documentation

webexteams.message() function

Flux 0.125.0+

The webexteams.message() function is a user-contributed function maintained by the package author and can be updated or removed at any time.

The webexteams.message() function sends a single message to Webex using the Webex messages API.

import "contrib/sranka/webexteams"

webexteams.message(,
  url: "https://webexapis.com"
  token: "My5uP3rs3cRe7T0k3n",
  roomId: "Y2lzY29zcGFyazovL3VzL1JPT00vYmJjZWIxYWQtNDNmMS0zYjU4LTkxNDctZjE0YmIwYzRkMTU0",
  text: "Example plain text message",
  markdown: "Example [markdown message](https://developer.webex.com/docs/api/basics)." 
)

Parameters

url

Base URL of Webex API endpoint (without a trailing slash). Default is https://webexapis.com.

token

(Required) Webex API access token.

roomId

(Required) Room ID to send the message to.

text

(Required) Plain text message.

markdown

(Required) Markdown formatted message.

Examples

Send the last reported status to Webex Teams
import "contrib/sranka/webexteams"
import "influxdata/influxdb/secrets"

apiToken = secrets.get(key: "WEBEX_API_TOKEN")

lastReported =
  from(bucket: "example-bucket")
    |> range(start: -1m)
    |> filter(fn: (r) => r._measurement == "statuses")
    |> last()
    |> findRecord(fn: (key) => true, idx: 0)

webexteams.message(
  token: apiToken,
  roomId: "Y2lzY29zcGFyazovL3VzL1JPT00vYmJjZWIxYWQtNDNmMS0zYjU4LTkxNDctZjE0YmIwYzRkMTU0",
  text: "Disk usage is ${lastReported.status}.",
  markdown: "Disk usage is **${lastReported.status}**."
)

Package author and maintainer

Github: @sranka
InfluxDB Slack: @sranka


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.