Update my preferences
curl --request PATCH \
--url https://{your-subdomain}.neetokb.com/api/external/v2/my_preferences \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"my_preferences": {
"monthly_reports_mail": true
}
}
'const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({my_preferences: {monthly_reports_mail: true}})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/my_preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/my_preferences"
payload = { "my_preferences": { "monthly_reports_mail": True } }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"monthly_reports_mail": true
}{
"error": "No changes were given, so nothing was updated."
}My preferences
Update my preferences
This API updates the preferences of the signed-in user. It needs no extra permission, because the data is the user’s own. An API key has no user, so the request is refused. The put method works too.
PATCH
/
my_preferences
Update my preferences
curl --request PATCH \
--url https://{your-subdomain}.neetokb.com/api/external/v2/my_preferences \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"my_preferences": {
"monthly_reports_mail": true
}
}
'const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({my_preferences: {monthly_reports_mail: true}})
};
fetch('https://{your-subdomain}.neetokb.com/api/external/v2/my_preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{your-subdomain}.neetokb.com/api/external/v2/my_preferences"
payload = { "my_preferences": { "monthly_reports_mail": True } }
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"monthly_reports_mail": true
}{
"error": "No changes were given, so nothing was updated."
}Replace
Learn how to find your subdomain in Workspace subdomain.
{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Body
application/json
Response
OK - Request succeeded
Example:
true