Zendesk find user by email
Asked Answered
E

5

5

How do you search to see if a user exists in Zendesk?

I've tried the following, where mydomain is the domain of my company:

https://mydomain.zendesk.com/api/v2/users/[email protected]

This is documented in their API:

http://developer.zendesk.com/documentation/rest_api/users.html#search-users

However, I am getting an HTTP 404 error as the response:

{"error": "InvalidEndpoint", "description": "Not found"} 
Eustatius answered 22/7, 2014 at 18:41 Comment(1)
The API endpoint is correct, I have just tested and it works fine. Are you sure you have authenticated before requesting?Odoriferous
M
10

Its simple, just do:

https://mydomain.zendesk.com/api/v2/users/search.json?query=email:[email protected]

Hope it helps.

Maximilian answered 27/9, 2018 at 17:5 Comment(0)
W
3

We've put together a useful nuget package if you're working with C#.

You can use the package to create a ZendeskApiClient:

IZendeskClient client = new ZendeskClient(
    new Uri("my-zendesk-api-host-endpoint"),
    "my-zendesk-username",
    "my-zendesk-token"
);

Then you can use the Search resource to find users:

var response = client.Search.Find(new ZendeskQuery<User>().WithCustomFilter("email", "usersEmail"));

Have a look at our blog for more detail.

Waylay answered 24/9, 2014 at 14:58 Comment(0)
D
3
https://mydomain.zendesk.com/api/v2/users/search.json?query=email:[email protected]

In case email consist special chars ([email protected]) it wont work. But urlencode can help.

Drice answered 1/4, 2020 at 13:5 Comment(0)
L
2

This is how to do it with the Zendesk PHP API Client Library:

$client->users()->search(array("query"=>"[email protected]"));

Lesterlesya answered 14/1, 2015 at 8:58 Comment(0)
A
0

Though a v late response but might be helpful for someone in future.

Please make sure that you make proper use of POST, PUT and GET accordingly. I got an error

Array([error] => InvalidEndpoint, [description] => Not found)

while coding which was because I was using POST instead of GET while searching user in Zendesk using API.

Here is a v helpful article too on adding/updating users to Zendesk Zendesk API Implementation In Codeigniter

Acima answered 14/12, 2014 at 17:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.