Find user by date


Find users using linux timestamp range.

GET

/users/?search=:type&min=:timestamp&max=:timestamp

Parameters
Type
Description
search
string
4 types to choose from: first_seen, last_seen, last_contacted, updated_at
min
timestamp
Start date of search
max
timestamp
End date of search
curl -X GET -H "Authorization: Token <your_64_char_api_key>" -H "Content-Type: application/json" "https://app.userengage.com/api/public/users/?search=last_seen&min=1477008000&max=1477139136"

Response

{
  "next": null,
  "count": 1,
  "results": [
    {
      "google_url": null,
      "first_seen": null,
      "region": null,
      "unsubscribed": false,
      "city": null,
      "name": "Jane Doe",
      "browser_language": null,
      "gravatar_url": "https://randomuser.me/api/portraits/men/51.jpg",
      "updated_at": "2017-06-14T07:06:18.495809Z",
      "gender": "unknown",
      "phone_number": null,
      "last_seen": "2017-06-14T11:06:08.182761Z",
      "id": 19678376,
      "os_type": null,
      "notifications": true,
      "country": null,
      "page_views": 0,
      "timezone": null,
      "score": 0,
      "linkedin_url": null,
      "tags": [
        {
          "id": 1441,
          "name": "tag"
        }
      ],
      "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
        }
      ],
      "twitter_url": null,
      "key": "g3FaYocCy0U6",
      "created_at": "2017-06-07T09:41:13.466897Z",
      "facebook_url": null,
      "last_contacted": null,
      "lists": [],
      "chat_id": "Chat ID is deprecated and will be removed in future",
      "resolution": null,
      "last_ip": null,
      "status": "visitor",
      "email": "updated@email.com",
      "browser": null
    }
  ],
  "previous": null
}
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://app.userengage.com/api/public/users/?search=last_seen&min=1477008000&max=1477139136",
  "method": "GET",
  "headers": {
    "authorization": "Token <your_64_char_api_key>",
    "content-type": "application/json"
  }
}

$.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://app.userengage.com/api/public/users/?search=last_seen&min=1477008000&max=1477139136");
xhr.setRequestHeader("authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.userengage.com/api/public/users/',
  qs: { search: 'last_seen', min: '1477008000', max: '1477139136' },
  headers:
   { 'content-type': 'application/json',
     authorization: 'Token <your_64_char_api_key>' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.userengage.com/api/public/users/?search=last_seen&min=1477008000&max=1477139136",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "authorization: Token <your_64_char_api_key>",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>
import requests

url = "https://app.userengage.com/api/public/users/"

querystring = {"search":"last_seen","min":"1477008000","max":"1477139136"}

headers = {
    'authorization': "Token <your_64_char_api_key>",
    'content-type': "application/json"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
import http.client

conn = http.client.HTTPSConnection("app.userengage.com")

headers = {
    'authorization': "Token <your_64_char_api_key>",
    'content-type': "application/json"
    }

conn.request("GET", "/api/public/users/?search=last_seen&min=1477008000&max=1477139136", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))