Site icon Hip-Hop Website Design and Development

How might I go about using the API to search for a user by email, but ensuring that it is an exact match?

I am using the API currently to search for a user by email and then getting the ID if the user and then executing a change to the account based on the ID. The only issue is, it seems that when I search, the search doesn’t require it to be exact. I am wanting it to be exact.

Example is, I search for a user using:

"GET /wp-json/wp/v2/users?search=username@gmail.com HTTP/1.1" 200

It comes back with the correct user, but if I also tried:

"GET /wp-json/wp/v2/users?search=username@gmai HTTP/1.1" 200

That also came back with the user. I am developing just using a test site so I only have a few users, but I foresee that this could be a problem. I am needing to search for one specific user by email at a time and I was hoping that when I got a result back I could validate it by checking if the email address shown in the json search result matched the email that was passed to it, but it doesn’t look like it displays the email address in the results either.

Does anyone have any suggestions on what I can do to get things a bit closer to what I am after?