Custom REST routes for PDF generation, PDF status, and element screenshots.
Base path: /wp-json/prc-print-engine/v1
Auth summary
| Access | Routes |
|---|---|
edit_post for target post | POST /posts/{id}/generate-pdf, GET /posts/{id}/pdf |
edit_posts | POST /screenshot |
POST /posts/{id}/generate-pdf
Force-schedules PDF generation for the resolved PDF owner post.
Permission: current_user_can( 'edit_post', $id ) (and for the resolved owner).
Request
POST
/wp-json/prc-print-engine/v1/posts/123/generate-pdf
HeadersKey: value
Accept application/json
Response
200 OK
Response headers
Key: value
BodyJSON
{
"scheduled": true,
"postId": 123,
"attachmentId": 0,
"url": "",
"generatedAt": "",
"configured": true,
"pending": true
}Errors
| Code | Status | Meaning |
|---|---|---|
not_found | 404 | Post missing |
forbidden | 403 | Cannot edit owner post |
ineligible | 400 | Not published/public or type lacks print support |
service_not_configured | 503 | Firebase render endpoints missing |
action_scheduler_unavailable | 503 | Action Scheduler not loaded |
GET /posts/{id}/pdf
Returns stored PDF status for the post (resolves report owner when applicable).
Reference
5 fields
Response fields
Typed options, defaults, and constraints in one scannable reference.
-
attachmentIdnumber required -
Media attachment ID for the PDF.
-
urlurl required -
Public PDF URL when available.
-
generatedAtstring required -
Generation timestamp meta.
-
configuredboolean required -
Whether the render service is configured.
-
pendingboolean required -
Whether an Action Scheduler job is pending.
No fields match this filter.
POST /screenshot
Proxies an element screenshot request to Firebase.
Permission: current_user_can( 'edit_posts' ). Attaching to a post also requires edit_post on attachToPostId.
Reference
4 fields
Request body
Typed options, defaults, and constraints in one scannable reference.
-
urlurl required -
Page URL to render.
-
selectorstring required -
CSS selector for the element.
-
waitMsnumber -
Wait before capture.
-
attachToPostIdnumber -
Optional post to sideload the PNG onto.
No fields match this filter.
Success payload includes pngBase64, mimeType, and optionally attachmentId / url when attached.