Custom Attributes
Set Attribute Value
Set the value of custom attributes on an employee or contractor.
PATCH
/
attributes
cURL
curl --request PATCH \
--url https://api.zeal.com/attributes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"companyID": "<string>",
"attributes": [
{
"attributeID": "<string>",
"value": "<string>"
}
],
"employeeID": "<string>",
"contractorID": "<string>"
}
'import requests
url = "https://api.zeal.com/attributes"
payload = {
"companyID": "<string>",
"attributes": [
{
"attributeID": "<string>",
"value": "<string>"
}
],
"employeeID": "<string>",
"contractorID": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyID: '<string>',
attributes: [{attributeID: '<string>', value: '<string>'}],
employeeID: '<string>',
contractorID: '<string>'
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'companyID' => '<string>',
'attributes' => [
[
'attributeID' => '<string>',
'value' => '<string>'
]
],
'employeeID' => '<string>',
'contractorID' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/attributes"
payload := strings.NewReader("{\n \"companyID\": \"<string>\",\n \"attributes\": [\n {\n \"attributeID\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"employeeID\": \"<string>\",\n \"contractorID\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.zeal.com/attributes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyID\": \"<string>\",\n \"attributes\": [\n {\n \"attributeID\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"employeeID\": \"<string>\",\n \"contractorID\": \"<string>\"\n}")
.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::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyID\": \"<string>\",\n \"attributes\": [\n {\n \"attributeID\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"employeeID\": \"<string>\",\n \"contractorID\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"companyID": "6cb3b69463ad41c986bc2b6d64d68a46",
"attributeID": "9ecd856e8b3c4337a6330dcadf2a8fc4",
"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": "XS",
"defaultValue": " "
},
{
"companyID": "6cb3b69463ad41c986bc2b6d64d68a46",
"attributeID": "694eb6b06441415088a25bd0fae84171",
"type": "boolean",
"name": "Acknowledge",
"label": "Agree",
"description": "",
"value": "false",
"defaultValue": false
},
{
"companyID": "6cb3b69463ad41c986bc2b6d64d68a46",
"attributeID": "c3267432fa464fd8b9b79b0d53552562",
"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 PATCH \
--url https://api.zeal.com/attributes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"companyID": "<string>",
"attributes": [
{
"attributeID": "<string>",
"value": "<string>"
}
],
"employeeID": "<string>",
"contractorID": "<string>"
}
'import requests
url = "https://api.zeal.com/attributes"
payload = {
"companyID": "<string>",
"attributes": [
{
"attributeID": "<string>",
"value": "<string>"
}
],
"employeeID": "<string>",
"contractorID": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyID: '<string>',
attributes: [{attributeID: '<string>', value: '<string>'}],
employeeID: '<string>',
contractorID: '<string>'
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'companyID' => '<string>',
'attributes' => [
[
'attributeID' => '<string>',
'value' => '<string>'
]
],
'employeeID' => '<string>',
'contractorID' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zeal.com/attributes"
payload := strings.NewReader("{\n \"companyID\": \"<string>\",\n \"attributes\": [\n {\n \"attributeID\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"employeeID\": \"<string>\",\n \"contractorID\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.zeal.com/attributes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyID\": \"<string>\",\n \"attributes\": [\n {\n \"attributeID\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"employeeID\": \"<string>\",\n \"contractorID\": \"<string>\"\n}")
.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::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyID\": \"<string>\",\n \"attributes\": [\n {\n \"attributeID\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"employeeID\": \"<string>\",\n \"contractorID\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"companyID": "6cb3b69463ad41c986bc2b6d64d68a46",
"attributeID": "9ecd856e8b3c4337a6330dcadf2a8fc4",
"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": "XS",
"defaultValue": " "
},
{
"companyID": "6cb3b69463ad41c986bc2b6d64d68a46",
"attributeID": "694eb6b06441415088a25bd0fae84171",
"type": "boolean",
"name": "Acknowledge",
"label": "Agree",
"description": "",
"value": "false",
"defaultValue": false
},
{
"companyID": "6cb3b69463ad41c986bc2b6d64d68a46",
"attributeID": "c3267432fa464fd8b9b79b0d53552562",
"type": "string",
"name": "test text",
"label": "test text",
"description": "",
"constraints": {
"minLength": 5,
"maxLength": 10,
"pattern": null
},
"value": " ",
"defaultValue": " "
}
],
"success": true,
"testMode": false
}