GET
/lists/:id/users/View user list
You can return all users assigned to a specific user list.
| Attributes | Type | Required | Description |
|---|---|---|---|
| id | integer | yes | A unique identifier for the users' list which is given by User.com automatically. |
Request
- CURL
- JavaScript
- PHP
- Python
curl -X GET -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2"
"https://<your_app_subdomain>.user.com/api/public/lists/:id/users/"
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://%3Cyour_app_subdomain%3E.user.com/api/public/lists/:id/users/");
xhr.setRequestHeader("Authorization", "Token <your_64_char_api_key>");
xhr.setRequestHeader("Accept", "*/*; version=2");
xhr.send();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://%3Cyour_app_subdomain%3E.user.com/api/public/lists/:id/users/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Token <your_64_char_api_key>',
'Accept: */*; version=2'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://<your_app_subdomain>.user.com/api/public/lists/:id/users/"
payload={}
headers = {
'Authorization': 'Token <your_64_char_api_key>',
'Accept': '*/*; version=2'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"first_seen": null,
"city": null,
"linkedin_url": null,
"unsubscribed": true,
"timezone": null,
"browser": null,
"score": 0,
"name": "John Doe",
"last_seen": null,
"country": null,
"google_url": null,
"resolution": null,
"tags": [],
"id": 18260675,
"updated_at": "2017-05-29T10:08:59.526309Z",
"last_ip": null,
"last_contacted": null,
"region": null,
"status": "visitor",
"gravatar_url": null,
"created_at": "2017-05-29T10:08:59.526286Z",
"browser_language": null,
"gender": "unknown",
"email": "example@email.com",
"twitter_url": null,
"page_views": 0,
"phone_number": null,
"facebook_url": null,
"chat_id": "Chat ID is deprecated and will be removed in future",
"attributes": [
{
"id": 2092,
"name_std": "an_attribute",
"value": "Value for the attribute",
"name": "An Attribute"
}
],
"notifications": true,
"key": "rQ8mdQ8W6I5t",
"lists": [],
"os_type": null
},
{
"first_seen": null,
"city": null,
"linkedin_url": null,
"unsubscribed": false,
"timezone": null,
"browser": null,
"score": 0,
"name": "Jane Doe",
"last_seen": null,
"country": null,
"google_url": null,
"resolution": null,
"tags": [],
"id": 20901703,
"updated_at": "2017-06-13T12:51:30.924647Z",
"last_ip": null,
"last_contacted": null,
"region": null,
"status": "visitor",
"gravatar_url": null,
"created_at": "2017-06-13T12:22:38.748373Z",
"browser_language": null,
"gender": "unknown",
"email": "example@email.org",
"twitter_url": null,
"page_views": 0,
"phone_number": null,
"facebook_url": null,
"chat_id": "Chat ID is deprecated and will be removed in future",
"attributes": [],
"notifications": true,
"key": "xSoYQG00fg9z",
"lists": [],
"os_type": null
}
]
}