GET
/all-attributes/:model/Get all attributes
You can get a list of all attribute names and their types for each model.
| Attributes | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Specific model with its own list of attributes.
|
Request
- CURL
- JavaScript
- PHP
- Python
curl "https://<your_app_subdomain>.user.com/api/public/all-attributes/:model/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
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/all-attributes/:model/");
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://<your_app_subdomain>.user.com/api/public/all-attributes/:model/",
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(
"Accept: */*; version=2",
"Authorization: Token <your_64_char_api_key>"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://<your_app_subdomain>.user.com/api/public/all-attributes/:model/"
headers = {
'Authorization': 'Token <your_64_char_api_key>',
'Accept': '*/*; version=2'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
Response
[
{
"name": "key",
"type": "string"
},
{
"name": "user_id",
"type": "string"
},
{
"name": "assigned_to",
"type": "integer"
},
{
"name": "last_contacted",
"type": "datetime"
},
{
"name": "last_heard_from",
"type": "datetime"
},
{
"name": "email",
"type": "string"
},
{
"name": "gender",
"type": "fixed",
"choices": [
{
"1": "unknown"
},
{
"2": "male"
},
{
"3": "female"
}
],
"allow_multiple_choices": false
},
{
"name": "status",
"type": "fixed",
"choices": [
{
"1": "visitor"
},
{
"2": "user"
}
],
"allow_multiple_choices": false
},
{
"name": "first_name",
"type": "string"
},
{
"name": "last_name",
"type": "string"
},
{
"name": "phone_number",
"type": "string"
},
{
"name": "first_seen",
"type": "datetime"
},
{
"name": "last_seen",
"type": "datetime"
},
{
"name": "page_views",
"type": "integer"
},
{
"name": "last_ip",
"type": "string"
},
{
"name": "hostname",
"type": "string"
},
{
"name": "referrer",
"type": "string"
},
{
"name": "country",
"type": "string"
},
{
"name": "region",
"type": "string"
},
{
"name": "city",
"type": "string"
},
{
"name": "geofencing_location",
"type": "json"
},
{
"name": "unsubscribed_from_sms",
"type": "boolean"
},
{
"name": "device",
"type": "fixed",
"choices": [
{
"1": "mobile"
},
{
"2": "desktop"
},
{
"3": "tablet"
}
],
"allow_multiple_choices": false
},
{
"name": "os_type",
"type": "string"
},
{
"name": "browser",
"type": "string"
},
{
"name": "browser_language",
"type": "string"
},
{
"name": "widget_language",
"type": "string"
},
{
"name": "browser_version",
"type": "integer"
},
{
"name": "resolution",
"type": "string"
},
{
"name": "current_url",
"type": "string"
},
{
"name": "score",
"type": "integer"
},
{
"name": "facebook_url",
"type": "string"
},
{
"name": "linkedin_url",
"type": "string"
},
{
"name": "twitter_url",
"type": "string"
},
{
"name": "google_url",
"type": "string"
},
{
"name": "unsubscribed",
"type": "boolean"
},
{
"name": "whatsapp_unsubscribed",
"type": "boolean"
},
{
"name": "spambounced",
"type": "boolean"
},
{
"name": "softbounced",
"type": "boolean"
},
{
"name": "hardbounced",
"type": "boolean"
},
{
"name": "notifications",
"type": "boolean"
},
{
"name": "email_mx_valid",
"type": "boolean"
},
{
"name": "created_at",
"type": "datetime"
},
{
"name": "updated_at",
"type": "datetime"
},
{
"name": "lt_opened_email",
"type": "datetime"
},
{
"name": "lt_clicked_email",
"type": "datetime"
},
{
"name": "most_active_time",
"type": "datetime"
},
{
"name": "is_active",
"type": "boolean"
},
{
"name": "widget_visibility",
"type": "fixed",
"choices": [
{
"1": "Widget is visible"
},
{
"2": "Widget is not visible"
}
],
"allow_multiple_choices": false
},
{
"name": "Boolean attribute",
"type": "boolean"
},
{
"name": "Date attribute",
"type": "date"
},
{
"name": "Datetime attribute",
"type": "datetime"
},
{
"name": "Fixed choices attribute",
"type": "fixed",
"choices": [
{
"A": "A"
},
{
"B": "B"
}
],
"allow_multiple_choices": true
},
{
"name": "Floating-point number attribute",
"type": "float"
},
{
"name": "Integer attribute",
"type": "integer"
},
{
"name": "JSON attribute",
"type": "json"
},
{
"name": "String attribute",
"type": "string"
}
]