# Ansible with Gotify Notifications

**URL:** <https://forum.ansible.com/t/ansible-with-gotify-notifications/3157>\
**Category:** Get Help\
**Tags:** playbook\
**Created:** [January 4, 2024, 12:13pm UTC](https://forum.ansible.com/t/ansible-with-gotify-notifications/3157 "2024-01-04T12:13:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [January 4, 2024, 12:49pm UTC](https://forum.ansible.com/t/ansible-with-gotify-notifications/3157/2 "2024-01-04T12:49:26Z")

</div>

> [@nicedevil](#):
>
> ```auto
> url: https://gotify.mydomain.com/message?token=XXXXXXX -F '"message=Disk space on {{ inventory_hostname }} is above 90%!"'
> 
> ```

Try quoting and URL encoding the URL and perhaps omit the quotes from the URL, eg:

```auto
url: "https://gotify.mydomain.com/message?token=XXXXXXX%20-F%20message=Disk%20space%20on%20{{ inventory_hostname }}%20is%20above%2090%!"

```

Or omit the query string altogether and submit the data as JSON, there seems to be little point in submitting data the using a query string unless you are forced to use GET rather than POST? It would also be a better in terms of security to not submit the `token` value in the URL.

See also this thread relating to the same error:

> [@Uri module reports "URL can't contain control character"](http://forum.ansible.com/t/uri-module-reports-url-cant-contain-control-character/2638):
>
> Hi - I’m trying to use the uri module to execute a GET that includes a ‘filter’ option in the URL: “https://{hostname}:8443/api/v2/storage-systems?filter=name eq ‘[hostname.example.com](http://hostname.example.com)’” The uri module execution fails with: "msg": "Status code was -1 and not [200, 201, 401]: An unknown error occurred: URL can't contain control characters. \"/api/v2/storage-systems?filter=name eq 'hostname.example.com'\" (found at least ' ')", I need to use the ‘filter’ option to retrieve only the records I ne…

Which was automatically closed 17 hours ago, I personally think threads should be left open for longer than the current time limit, this discussion could have taken place on that thread or this thread could have been merged into that one…

Both threads relate to the same error message from the URI module:

> URL can’t contain control characters.

---

_[View the full topic](https://forum.ansible.com/t/ansible-with-gotify-notifications/3157)._
