# API bug : final "." in username causes error

**URL:** <https://meta.discourse.org/t/api-bug-final-in-username-causes-error/230677>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [June 21, 2022, 9:27pm UTC](https://meta.discourse.org/t/api-bug-final-in-username-causes-error/230677 "2022-06-21T21:27:28Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Daniel\_McQuillen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_mcquillen/32/160806_2.png) [@Daniel\_McQuillen](https://meta.discourse.org/u/Daniel_McQuillen)\
**Post date:** [June 21, 2022, 9:27pm UTC](https://meta.discourse.org/t/api-bug-final-in-username-causes-error/230677/1 "2022-06-21T21:27:28Z")

</div>

We’re using the API to integrate Discourse into our site (via pydiscourse).

When it’s time to add a user to a Discourse group via the API, pydiscourse uses the PUT method to the Discourse API url:

` /admin/groups/{group_id}/members.json`

…and passes in the username via the ‘usernames’ variable.

If the username contains a “.” in it, there’s no problem, unless that “.” appears as the last character, in which case the API will return an error with the message:

```plaintext
You supplied invalid parameters to the request: usernames

```

---

_[View the full topic](https://meta.discourse.org/t/api-bug-final-in-username-causes-error/230677)._
