Contents
Export Testimonials as PDF - Plugixa Testimonial
GET /plugixatestimonial/v1/import-export/export/pdf
Download testimonials as an A4 PDF: name, role and company, stars, text, categories and date for each.
Administrators only: the user needs WordPress’s manage_options capability. No plugin capability opens this route. Needs Plugixa Testimonial Pro: the free build does not register this route, so it answers 404 there.
Note. Text in Arabic, Hebrew and Indic scripts is set with bundled fonts, but Chinese, Japanese and Korean text is not supported. See PDF export.
Request
GET https://your-site.example/wp-json/plugixatestimonial/v1/import-export/export/pdf?status=approved
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
ids[] |
integer[] |
Export exactly these testimonials. When sent, every filter is ignored. | |
search |
string |
Text found in the name, the testimonial or the company. Same as filter[search]. |
|
status |
string |
pending, approved, rejected or draft. Same as filter[status]; send filter[status][] several times for more than one. |
|
filter[categories][] |
integer[] |
Testimonials in any of these categories. | |
filter[rating_min] |
integer |
At least this many stars. | |
filter[rating_max] |
integer |
At most this many stars. | |
filter[is_featured] |
integer |
1 for featured only, 0 for the rest. |
|
filter[date_from] |
string |
Created on or after this day, YYYY-MM-DD. |
|
filter[date_to] |
string |
Created on or before this day, YYYY-MM-DD. |
With no parameter, every testimonial in every status and language is exported, newest first. There is no paging. See Import and export.
Responses
200 OK. The body is the PDF file.
%PDF-1.4
...
The response is the file itself, not the JSON envelope, sent as an attachment named testimonials-export-YYYY-MM-DD.pdf (UTC date) with caching turned off.
Errors
| Status | Code | When |
|---|---|---|
404 |
rest_error |
“No testimonials to export”: nothing matched. |
500 |
rest_error |
“Failed to generate PDF: “ followed by the reason. |
Plus the errors every endpoint can return.
Examples
curl -sg "https://your-site.example/wp-json/plugixatestimonial/v1/import-export/export/pdf?status=approved" \
-u "admin:$WP_APP_PASSWORD" \
-o testimonials.pdf
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixatestimonial/v1/import-export/export/pdf?status=approved');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
file_put_contents('testimonials.pdf', curl_exec($ch));
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixatestimonial/v1/import-export/export/pdf?status=approved', {
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const file = await response.blob();
Quick Links
Share