Custom Attributes
Get Attributes
Retrieve the custom attributes set on an employee or contractor.
GET
/
attributes
cURL
curl --request GET \
--url https://api.zeal.com/attributes \
--header 'Authorization: <api-key>'import requests
url = "https://api.zeal.com/attributes"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.zeal.com/attributes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zeal.com/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/attributes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zeal.com/attributes")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"companyID": "dcb3bd9403ad41c98bbc2b4d54d88a44",
"attributeID": "9ecd856e-8b3c-4337-a633-0dcadf2a8fc4",
"type": "options",
"name": "T-shirt size",
"label": "T-shirt size",
"description": "",
"options": [
{
"value": "S",
"name": "S"
},
{
"value": "M",
"name": "M"
},
{
"value": "L",
"name": "L"
},
{
"value": "XL",
"name": "XL"
}
],
"value": "XL",
"defaultValue": " "
},
{
"companyID": "dcb3bd9403ad41c98bbc2b4d54d88a44",
"attributeID": "694eb6b0-6441-4150-88a2-5bd0fae84171",
"type": "boolean",
"name": "Acknowledge",
"label": "Agree",
"description": "",
"value": "false",
"defaultValue": false
},
{
"companyID": "dcb3bd9403ad41c98bbc2b4d54d88a44",
"attributeID": "c3267432-fa46-4fd8-b9b7-9b0d53552562",
"type": "string",
"name": "test text",
"label": "test text",
"description": "",
"constraints": {
"minLength": 5,
"maxLength": 10,
"pattern": null
},
"value": " ",
"defaultValue": " "
}
],
"success": true,
"testMode": false
}⌘I
cURL
curl --request GET \
--url https://api.zeal.com/attributes \
--header 'Authorization: <api-key>'import requests
url = "https://api.zeal.com/attributes"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.zeal.com/attributes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zeal.com/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/attributes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zeal.com/attributes")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zeal.com/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"companyID": "dcb3bd9403ad41c98bbc2b4d54d88a44",
"attributeID": "9ecd856e-8b3c-4337-a633-0dcadf2a8fc4",
"type": "options",
"name": "T-shirt size",
"label": "T-shirt size",
"description": "",
"options": [
{
"value": "S",
"name": "S"
},
{
"value": "M",
"name": "M"
},
{
"value": "L",
"name": "L"
},
{
"value": "XL",
"name": "XL"
}
],
"value": "XL",
"defaultValue": " "
},
{
"companyID": "dcb3bd9403ad41c98bbc2b4d54d88a44",
"attributeID": "694eb6b0-6441-4150-88a2-5bd0fae84171",
"type": "boolean",
"name": "Acknowledge",
"label": "Agree",
"description": "",
"value": "false",
"defaultValue": false
},
{
"companyID": "dcb3bd9403ad41c98bbc2b4d54d88a44",
"attributeID": "c3267432-fa46-4fd8-b9b7-9b0d53552562",
"type": "string",
"name": "test text",
"label": "test text",
"description": "",
"constraints": {
"minLength": 5,
"maxLength": 10,
"pattern": null
},
"value": " ",
"defaultValue": " "
}
],
"success": true,
"testMode": false
}