Contents
Get Text Message Settings - Plugixa PDF Vouchers for WooCommerce
GET /plugixa-pdf-vouchers/v1/sms/settings
The settings of SMS and WhatsApp. The auth token never leaves the server: only whether one is set and its last four characters.
Needs a user with the plugixa_pdfv_manage_settings capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Administrators and shop managers get it when the plugin is activated; see Staff access.
Note. Pro only: on the free plugin this route answers
404rest_no_route.
Request
GET https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/sms/settings
Responses
200 OK.
{
"success": true,
"data": {
"sid": "AC3f6b9c2e1d4a5b6c7d8e9f0a1b2c3d4e",
"from": "+33644630001",
"whatsapp_from": "",
"token_set": true,
"token_hint": "••••9f2c"
}
}
| Field | Type | Meaning |
|---|---|---|
data.sid |
string |
The Twilio Account SID |
data.from |
string |
The number text messages are sent from |
data.whatsapp_from |
string |
The WhatsApp sender, empty when not set |
data.token_set |
boolean |
Whether an auth token is stored |
data.token_hint |
string |
Its last four characters |
Errors
| Status | Code | When |
|---|---|---|
401 / 403 |
plugixa_pdfv_forbidden |
The caller lacks the capability. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/sms/settings" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/sms/settings');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-store.example/wp-json/plugixa-pdf-vouchers/v1/sms/settings', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share