import CodeBlock from "@theme/CodeBlock";
import data_message from "!!raw-loader!./../../../../../bindings/python/examples/08_data_message.py";

You can use the `data` parameter in the
[`Client.message()`](./../libraries/python/api_reference#messageseed-optional-account_index-optional-initial_address_index-optional-inputs-optional-input_range_begin-optional-input_range_end-optional-outputs-optional-dust_allowance_outputs-optional-index-optional-index_raw-optional-data-optional-data_str-optional-parents-optional-message)
function to attach data to a message.

<CodeBlock className="language-python">{data_message}</CodeBlock>

**Output example**:

```json
{
  "message_id": "8d4fa37be3c00691131c2c3e03e7b8b956c9118a2ce4be3a8597d51d82ed2de9",
  "network_id": 7712883261355838377,
  "parents": [
    "3719d308ae14b7ef1ed5a3a1604228e97587b9da487db10bc6e4a4f800083da0",
    "4431e2f776db888488728e0aa34c94975e65d6fa74893aa675172af6b9f37257",
    "8f9fa84954c58bcfc9acc33ca827b4ea35c2caae88db736399a031120e85eebf",
    "f63d416de97e6a9fd1314fbbbbb263f30dff260f3075f9a65e7dfe1f2cc56ce3"
  ],
  "payload": {
    "transaction": "None",
    "milestone": "None",
    "indexation": [
      {
        "index": "736f6d655f646174615f696e646578",
        "data": [115, 111, 109, 101, 32, 117, 116, 102, 32, 98, 97, 115, 101, 100, 32, 100, 97, 116, 97]
      }
    ],
    "receipt": "None",
    "treasury_transaction": "None"
  },
  "nonce": 6917529027641573188
}
```