# cisco_spark – Send a message to a Cisco Spark Room or Individual

- Synopsis

- Parameters

- Notes

- Examples

- Return Values

- Status

## Synopsis

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

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
message - / required |  | The message you would like to send.

message_type
-

Choices:
- text ←
- markdown

Specifies how you would like the message formatted.

personal_token - / required |  | Your personal access token required to validate the Spark API. aliases: token
recipient_id - / required |  | The unique identifier associated with the supplied `recipient_type`.

recipient_type
- / required

Choices:
- 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).

## Notes

Note

- The `recipient_id` type must be valid for the supplied `recipient_id`.

- Full API documentation can be found at https://developer.ciscospark.com/endpoint-messages-post.html.

## 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, the following are the fields unique to this module:

Key | Returned | Description
--- | --- | ---
message string | always | The Response Message returned by the Spark API. Full Response Code explanations can be found at https://developer.ciscospark.com/endpoint-messages-post.html. Sample: OK (585 bytes)
status_code integer | always | The Response Code returned by the Spark API. Full Response Code explanations can be found at https://developer.ciscospark.com/endpoint-messages-post.html. Sample: 200

## Status

- This module is guaranteed to have backward compatible interface changes going forward. [stableinterface]

- This module is maintained by the Ansible Community. [community]

### Authors

- Drew Rusell (@drew-russell)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.