Find user by email
Easiest way to find a certain user. By providing an email address (which can be probably retrieved from your app) you’ll get a response of a user model (request without ‘many’ parameter in the endpoint) or a list of all user models with the same email (when ‘many’ parameter is provided).
GET
/users/search/?email=:email
Attributes
Type
Description
email
string
Email address of a user you want to search for
curl -X GET -H "Authorization: Token <your_64_char_api_key>" "https://<your_app_subdomain>.user.com/api/public/users/search/?email=:email"
Example response
{
"facebook_url": null,
"region": null,
"notifications": true,
"last_ip": null,
"attributes": [
{
"value": true,
"name": "Example attr",
"name_std": "example_attr",
"id": 1109
},
{
"value": "attribute value",
"name": "My string attr",
"name_std": "my_string_attr",
"id": 2429
}
],
"country": null,
"resolution": null,
"name": "Jane Doe",
"browser_language": null,
"email": "example@email.com",
"os_type": null,
"created_at": "2017-06-07T09:41:13.466897Z",
"unsubscribed": false,
"timezone": null,
"gravatar_url": null,
"chat_id": "Chat ID is deprecated and will be removed in future",
"browser": null,
"key": "g3FaYocCy0U6",
"id": 19678376,
"updated_at": "2017-06-07T10:29:15.955873Z",
"score": 0,
"google_url": null,
"city": null,
"first_seen": null,
"status": "visitor",
"tags": [
{
"name": "tag",
"id": 1441
}
],
"gender": "unknown",
"linkedin_url": null,
"twitter_url": null,
"last_contacted": null,
"phone_number": null,
"lists": [],
"last_seen": null,
"page_views": 0
}
{
"facebook_url": null,
"region": null,
"notifications": true,
"last_ip": null,
"attributes": [
{
"value": true,
"name": "Example attr",
"name_std": "example_attr",
"id": 1100
},
{
"value": "attribute value",
"name": "My string attr",
"name_std": "my_string_attr",
"id": 2400
}
],
"country": null,
"resolution": null,
"name": "Christian Dior",
"browser_language": null,
"email": "example@email.com",
"os_type": null,
"created_at": "2017-06-07T09:41:13.466897Z",
"unsubscribed": false,
"timezone": null,
"gravatar_url": null,
"chat_id": "Chat ID is deprecated and will be removed in future",
"browser": null,
"key": "g3FaYocCy0U6",
"id": 1949376,
"updated_at": "2017-06-07T10:29:15.955873Z",
"score": 0,
"google_url": null,
"city": null,
"first_seen": null,
"status": "visitor",
"tags": [
{
"name": "tag2",
"id": 1440
}
],
"gender": "unknown",
"linkedin_url": null,
"twitter_url": null,
"last_contacted": null,
"phone_number": null,
"lists": [],
"last_seen": null,
"page_views": 0
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://<your_app_subdomain>.user.com/api/public/users/search/?email=:email",
"method": "GET",
"headers": {
"authorization": "Token <your_64_char_api_key>"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://<your_app_subdomain>.user.com/api/public/users/search/?email=:email");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.send(data);
var request = require("request");
var options = { method: 'GET',
url: 'https://<your_app_subdomain>.user.com/api/public/users/search/',
qs: { email: ':email' },
headers: { authorization: 'Token <your_64_char_api_key>' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$request = new HttpRequest();
$request->setUrl('https://<your_app_subdomain>.user.com/api/public/users/search/');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'email' => ':email'
));
$request->setHeaders(array(
'authorization' => 'Token <your_64_char_api_key>'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import requests
url = "https://<your_app_subdomain>.user.com/api/public/users/search/"
querystring = {"email":":email"}
headers = {'authorization': 'Token <your_64_char_api_key>'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)