Grafana API, don't get user by email

Hello.
I created a user with a plus in email: user+test@test.com.
I used “GET /api/users/lookup?loginOrEmail=user+test@test.com” API, but response “User not found” with 404 status code.
Also I tried to use “GET /api/users/search?query=user+test” API, response with empty users.

Why the API doesn’t find a user with a plus in email?

You need to encode the plus sign when used for url, url encode that is

I also used encoded url “GET /api/users/lookup?loginOrEmail=user%2Btest@test.com”, response “User not found” with 404.

user%2Btest%40test.com is URL encoded value of user+test@test.com.
Credit: https://www.urlencoder.org/

Thanks for help!:+1:

Hi there,

I’m facing mostly the same issue, maybe can somebody help me to resolve it

I have a text in my metric legend that looked like the below, also it is parsed by regex and used in the clickthrough option, so it get into URL and should be encoded

some_email+some_text@domain.com SOME_TEXT

To parse it I’m using the regex expression below

(^\S*)\s+(.*) and all works except encoding + sign from the first var to URL format.

After parsing it looks like this some_email some_text@domain.com SOME_TEXT , where the plus sign is replaced by whitespace