Documentation

cisco_spark - Send a message to a Cisco Spark Room or Individual.

New in version 2.3.

Synopsis

  • Send a message to a Cisco Spark Room or Individual with options to control the formatting.

Options

parameter required default choices comments
message
yes
The message you would like to send.
message_type
no text
  • text
  • markdown
Specifies how you would like the message formatted.
personal_token
yes
Your personal access token required to validate the Spark API.

aliases: token
recipient_id
yes
The unique identifier associated with the supplied recipient_type.
recipient_type
yes
  • roomId
  • toPersonEmail
  • toPersonId
The request parameter you would like to send the message to.
Messages can be sent to either a room or individual (by ID or E-Mail).

Examples

# Note: The following examples assume a variable file has been imported
# that contains the appropriate information.

- name: Cisco Spark - Markdown Message to a Room
  cisco_spark:
    recipient_type: roomId
    recipient_id: "{{ room_id }}"
    message_type: markdown
    personal_token: "{{ token }}"
    message: "**Cisco Spark Ansible Module - Room Message in Markdown**"

- name: Cisco Spark - Text Message to a Room
  cisco_spark:
    recipient_type: roomId
    recipient_id: "{{ room_id }}"
    message_type: text
    personal_token: "{{ token }}"
    message: "Cisco Spark Ansible Module - Room Message in Text"

- name: Cisco Spark - Text Message by an Individuals ID
  cisco_spark:
    recipient_type: toPersonId
    recipient_id: "{{ person_id}}"
    message_type: text
    personal_token: "{{ token }}"
    message: "Cisco Spark Ansible Module - Text Message to Individual by ID"

- name: Cisco Spark - Text Message by an Individuals E-Mail Address
  cisco_spark:
    recipient_type: toPersonEmail
    recipient_id: "{{ person_email }}"
    message_type: text
    personal_token: "{{ token }}"
    message: "Cisco Spark Ansible Module - Text Message to Individual by E-Mail"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
status_code ['The Response Code returned by the Spark API.', 'Full Responsde Code explanations can be found at U(https://developer.ciscospark.com/endpoint-messages-post.html).'] always int 200
message ['The Response Message returned by the Spark API.', 'Full Responsde Code explanations can be found at U(https://developer.ciscospark.com/endpoint-messages-post.html.'] always string OK (585 bytes)


Notes

Note

Status

This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.