ex_webexteams v0.1.4 ExWebexteams.Api.Shortcuts View Source

Shortcuts is a set of “shortcuts” to common api call. They are designed to be useable in a pipeline (described below)

Pipelines

Example sending messages

Send a text message to a room

@room = 12345
send_message("my message") |> by_room_id(@room) |> post_message

Send a file to a user

@user = "person@here.com"
@file = "https://files.com/funny.gif"
send_file(@file) |> to_person_email(@user) |> post_message

Example getting messages

Get the last message for me from a room

@room = 12345
find_my_messages([:max, 1]) |> by_room_id(@room) |> get_messages

Link to this section Summary

Functions

Get or Send a prepared message to a room by id

Find messages from a room

Post a prepared message to webex

Send a file (by url) with an optional description

Send a text message with optional markdown

Send a prepared message to a person by email

Send a prepared message to a person by id

Link to this section Functions

Link to this function by_room_id(msg, id) View Source
by_room_id(message(), String.t()) :: message()

Get or Send a prepared message to a room by id

Link to this function find_my_messages(options \\ %{}) View Source
find_my_messages(options()) :: options()

Find messages from a room

Options example

Before message “1234”

find_my_messages(%{"beforeMessage" => 1234})

Max of 10 messages before a time (ISO8601 yyyy-MM-dd'T'HH:mm:ss.SSSZ)

find_my_messages(%{"max" => 10, "before" => "2018-09-01T01:23:00.000Z"})
Link to this function get_messages(options, api \\ ExWebexteams.Api) View Source
get_messages(options(), function()) :: {:ok, any()}

Get a messages from webex

Link to this function post_message(msg, api \\ ExWebexteams.Api) View Source
post_message(message(), function()) :: {:ok, any()}

Post a prepared message to webex

Link to this function send_file(file, description \\ nil) View Source
send_file(String.t(), String.t()) :: message()

Send a file (by url) with an optional description

Link to this function send_message(text, markdown \\ nil) View Source
send_message(String.t(), String.t()) :: message()

Send a text message with optional markdown

Link to this function to_person_email(msg, email) View Source
to_person_email(message(), String.t()) :: message()

Send a prepared message to a person by email

Link to this function to_person_id(msg, id) View Source
to_person_id(message(), String.t()) :: message()

Send a prepared message to a person by id