Skip to main content
PUT
/
v1
/
notifications
/
staff
/
{staffId}
/
preferences
Update staff notification preferences
curl --request PUT \
  --url http://localhost:3000/v1/notifications/staff/{staffId}/preferences \
  --header 'Content-Type: application/json' \
  --data '
{
  "order_received": true,
  "customer_arrived": true,
  "task_assigned": true,
  "sweep_arrived": true,
  "shift_starting": true,
  "schedule_posted": true,
  "partner_brand_application": true,
  "partner_product_application": true,
  "email_enabled": true,
  "quiet_hours_enabled": true,
  "quiet_hours_start": "<string>",
  "quiet_hours_end": "<string>",
  "suppress_while_in_app": true
}
'
import requests

url = "http://localhost:3000/v1/notifications/staff/{staffId}/preferences"

payload = {
"order_received": True,
"customer_arrived": True,
"task_assigned": True,
"sweep_arrived": True,
"shift_starting": True,
"schedule_posted": True,
"partner_brand_application": True,
"partner_product_application": True,
"email_enabled": True,
"quiet_hours_enabled": True,
"quiet_hours_start": "<string>",
"quiet_hours_end": "<string>",
"suppress_while_in_app": True
}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
order_received: true,
customer_arrived: true,
task_assigned: true,
sweep_arrived: true,
shift_starting: true,
schedule_posted: true,
partner_brand_application: true,
partner_product_application: true,
email_enabled: true,
quiet_hours_enabled: true,
quiet_hours_start: '<string>',
quiet_hours_end: '<string>',
suppress_while_in_app: true
})
};

fetch('http://localhost:3000/v1/notifications/staff/{staffId}/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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/v1/notifications/staff/{staffId}/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'order_received' => true,
'customer_arrived' => true,
'task_assigned' => true,
'sweep_arrived' => true,
'shift_starting' => true,
'schedule_posted' => true,
'partner_brand_application' => true,
'partner_product_application' => true,
'email_enabled' => true,
'quiet_hours_enabled' => true,
'quiet_hours_start' => '<string>',
'quiet_hours_end' => '<string>',
'suppress_while_in_app' => true
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/v1/notifications/staff/{staffId}/preferences"

payload := strings.NewReader("{\n \"order_received\": true,\n \"customer_arrived\": true,\n \"task_assigned\": true,\n \"sweep_arrived\": true,\n \"shift_starting\": true,\n \"schedule_posted\": true,\n \"partner_brand_application\": true,\n \"partner_product_application\": true,\n \"email_enabled\": true,\n \"quiet_hours_enabled\": true,\n \"quiet_hours_start\": \"<string>\",\n \"quiet_hours_end\": \"<string>\",\n \"suppress_while_in_app\": true\n}")

req, _ := http.NewRequest("PUT", url, payload)

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.put("http://localhost:3000/v1/notifications/staff/{staffId}/preferences")
.header("Content-Type", "application/json")
.body("{\n \"order_received\": true,\n \"customer_arrived\": true,\n \"task_assigned\": true,\n \"sweep_arrived\": true,\n \"shift_starting\": true,\n \"schedule_posted\": true,\n \"partner_brand_application\": true,\n \"partner_product_application\": true,\n \"email_enabled\": true,\n \"quiet_hours_enabled\": true,\n \"quiet_hours_start\": \"<string>\",\n \"quiet_hours_end\": \"<string>\",\n \"suppress_while_in_app\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:3000/v1/notifications/staff/{staffId}/preferences")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_received\": true,\n \"customer_arrived\": true,\n \"task_assigned\": true,\n \"sweep_arrived\": true,\n \"shift_starting\": true,\n \"schedule_posted\": true,\n \"partner_brand_application\": true,\n \"partner_product_application\": true,\n \"email_enabled\": true,\n \"quiet_hours_enabled\": true,\n \"quiet_hours_start\": \"<string>\",\n \"quiet_hours_end\": \"<string>\",\n \"suppress_while_in_app\": true\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "preferences": {
    "staff_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "order_received": true,
    "customer_arrived": true,
    "task_assigned": true,
    "sweep_arrived": true,
    "shift_starting": true,
    "schedule_posted": true,
    "partner_brand_application": true,
    "partner_product_application": true,
    "email_enabled": true,
    "quiet_hours_enabled": true,
    "quiet_hours_start": "<string>",
    "quiet_hours_end": "<string>",
    "suppress_while_in_app": true
  }
}
{
"error": "<string>"
}

Path Parameters

staffId
string<uuid>
required

Body

application/json
order_received
boolean
customer_arrived
boolean
task_assigned
boolean
sweep_arrived
boolean
shift_starting
boolean
schedule_posted
boolean
partner_brand_application
boolean
partner_product_application
boolean
email_enabled
boolean
quiet_hours_enabled
boolean
quiet_hours_start
string
quiet_hours_end
string
suppress_while_in_app
boolean

Response

Updated preferences

success
boolean
required
preferences
object
required