Contents
Update Email Preferences - Plugixa Stream
PUT /plugixa-stream/v1/me/notifications
Change the caller’s email choices.
Any signed-in user (an Application Password, or the login cookie with an X-WP-Nonce header). Signed out, it answers 401 plugixa_stream_login_required. It always acts on the caller’s own account.
Request
PUT https://your-site.example/wp-json/plugixa-stream/v1/me/notifications
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
new_episodes |
boolean |
No | Emails about new episodes. Left out: unchanged. |
{
"new_episodes": true
}
Responses
200 OK.
{
"success": true,
"data": {
"new_episodes": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.new_episodes |
boolean |
As stored |
Errors
| Status | Code | When |
|---|---|---|
401 |
plugixa_stream_login_required |
Signed out. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-stream/v1/me/notifications" \
-u "$WP_USER:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"new_episodes":true}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/me/notifications');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'new_episodes' => true,
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/me/notifications', {
method: 'PUT',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ new_episodes: true }),
});
const { data } = await response.json();
Quick Links
Share