Change notification preferences
curl --request PATCH \
--url https://{host}/v1/me/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "notification-preferences",
"attributes": {
"categories": {
"price_drops": {
"push": false
},
"saved_searches": {
"push": false
}
}
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'notification-preferences',
attributes: {categories: {price_drops: {push: false}, saved_searches: {push: false}}}
}
})
};
fetch('https://{host}/v1/me/notification-preferences', 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://{host}/v1/me/notification-preferences",
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([
'data' => [
'type' => 'notification-preferences',
'attributes' => [
'categories' => [
'price_drops' => [
'push' => false
],
'saved_searches' => [
'push' => false
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/me/notification-preferences"
payload = { "data": {
"type": "notification-preferences",
"attributes": { "categories": {
"price_drops": { "push": False },
"saved_searches": { "push": False }
} }
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"type": "notification-preferences",
"id": "4711",
"attributes": {
"categories": {
"messages": {
"push": true,
"mail": true
},
"offers": {
"push": true,
"mail": true
},
"saved_searches": {
"push": true,
"mail": true
},
"price_drops": {
"push": false,
"mail": true
},
"orders": {
"push": true,
"mail": true
},
"shop": {
"push": true,
"mail": true
},
"security": {
"push": true,
"mail": true
}
},
"defaults": {
"messages": {
"push": true,
"mail": true
},
"offers": {
"push": true,
"mail": true
},
"saved_searches": {
"push": true,
"mail": true
},
"price_drops": {
"push": true,
"mail": true
},
"orders": {
"push": true,
"mail": true
},
"shop": {
"push": true,
"mail": true
},
"security": {
"push": true,
"mail": true
}
},
"labels": {
"messages": {
"label": "Messages",
"description": "Somebody replied in one of your conversations.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"offers": {
"label": "Offers",
"description": "An offer was accepted, refused, countered, or made to you.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"saved_searches": {
"label": "Saved searches",
"description": "A saved search found something new. How often is set per search.",
"locked": [
"push",
"mail"
],
"lockedNote": null,
"managedPerSearch": true
},
"price_drops": {
"label": "Price drops and favorites",
"description": "A watch you saved got cheaper, was reserved or was sold.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"orders": {
"label": "Orders",
"description": "Your payment was recognised, or your watch is on its way.",
"locked": [
"push",
"mail"
],
"lockedNote": "Always on: you need these to stay updated on your orders.",
"managedPerSearch": false
},
"shop": {
"label": "Your shop",
"description": "A buyer wrote to your shop, made an offer, or paid for a watch.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"security": {
"label": "Account security",
"description": "A sign-in, or a change to your password or second factor.",
"locked": [
"push",
"mail"
],
"lockedNote": "Always on, by email and in the app. This is how you find out somebody else changed your account.",
"managedPerSearch": false
}
}
}
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Account
Change notification preferences
Scope: account:write
Only what the body names is changed. A category left out keeps whatever it was.
null for a channel forgets the decision rather than refusing it, which is how
somebody goes back to the default without the app having to know what the default is.
false is a decision; null is the absence of one.
Turning off something that cannot be turned off (security, orders, and
saved_searches, which is set per search) answers
409 cannot_be_disabled, with a detail that says why for that category, rather
than quietly ignoring it: a switch that appears to work and does not is worse than one
that says no, because somebody would believe they had turned it off.
An unknown category or channel is 422, with source.pointer naming it.
PATCH
/
v1
/
me
/
notification-preferences
Change notification preferences
curl --request PATCH \
--url https://{host}/v1/me/notification-preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "notification-preferences",
"attributes": {
"categories": {
"price_drops": {
"push": false
},
"saved_searches": {
"push": false
}
}
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'notification-preferences',
attributes: {categories: {price_drops: {push: false}, saved_searches: {push: false}}}
}
})
};
fetch('https://{host}/v1/me/notification-preferences', 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://{host}/v1/me/notification-preferences",
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([
'data' => [
'type' => 'notification-preferences',
'attributes' => [
'categories' => [
'price_drops' => [
'push' => false
],
'saved_searches' => [
'push' => false
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/me/notification-preferences"
payload = { "data": {
"type": "notification-preferences",
"attributes": { "categories": {
"price_drops": { "push": False },
"saved_searches": { "push": False }
} }
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"type": "notification-preferences",
"id": "4711",
"attributes": {
"categories": {
"messages": {
"push": true,
"mail": true
},
"offers": {
"push": true,
"mail": true
},
"saved_searches": {
"push": true,
"mail": true
},
"price_drops": {
"push": false,
"mail": true
},
"orders": {
"push": true,
"mail": true
},
"shop": {
"push": true,
"mail": true
},
"security": {
"push": true,
"mail": true
}
},
"defaults": {
"messages": {
"push": true,
"mail": true
},
"offers": {
"push": true,
"mail": true
},
"saved_searches": {
"push": true,
"mail": true
},
"price_drops": {
"push": true,
"mail": true
},
"orders": {
"push": true,
"mail": true
},
"shop": {
"push": true,
"mail": true
},
"security": {
"push": true,
"mail": true
}
},
"labels": {
"messages": {
"label": "Messages",
"description": "Somebody replied in one of your conversations.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"offers": {
"label": "Offers",
"description": "An offer was accepted, refused, countered, or made to you.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"saved_searches": {
"label": "Saved searches",
"description": "A saved search found something new. How often is set per search.",
"locked": [
"push",
"mail"
],
"lockedNote": null,
"managedPerSearch": true
},
"price_drops": {
"label": "Price drops and favorites",
"description": "A watch you saved got cheaper, was reserved or was sold.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"orders": {
"label": "Orders",
"description": "Your payment was recognised, or your watch is on its way.",
"locked": [
"push",
"mail"
],
"lockedNote": "Always on: you need these to stay updated on your orders.",
"managedPerSearch": false
},
"shop": {
"label": "Your shop",
"description": "A buyer wrote to your shop, made an offer, or paid for a watch.",
"locked": [],
"lockedNote": null,
"managedPerSearch": false
},
"security": {
"label": "Account security",
"description": "A sign-in, or a change to your password or second factor.",
"locked": [
"push",
"mail"
],
"lockedNote": "Always on, by email and in the app. This is how you find out somebody else changed your account.",
"managedPerSearch": false
}
}
}
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Authorizations
oauth2bearerAuth
Body
application/vnd.api+json