REST APIeasy-svg-pro/v1/audit/originals/download

easy-svg-pro/v1/audit/originals/download

Returns one kept original as base64 inside JSON, so the browser can save it as a file.

REST endpoint · Easy SVG Pro · Status: Internal · Defined in includes/core/rest.php

Internal: not part of the promised public surface. It may change without notice.

Usage

GET /wp-json/easy-svg-pro/v1/audit/originals/download

Example

curl -u admin:app-password 'https://example.com/wp-json/easy-svg-pro/v1/audit/originals/download?ref=media:101'

Description

JSON on purpose: this origin never serves the unsafe bytes as an SVG a browser would draw. A set's original is its icon map, so it downloads as JSON. The ref must name a post of the kind it says, otherwise 404 easy_svg_pro_no_original. Permission: Requires manage_options, an active licence and the audit feature (SVG cleaner) switched on.

Permission: Requires manage_options, an active licence and the audit feature (SVG cleaner) switched on.

Parameters

query
refstring
Required

Which kept original: media:<id>, icon:<id> or set:<id>.

Return value

returnWP_REST_Response|WP_Error

filename, type, encoding (always base64) and content. 404 easy_svg_pro_no_original when there is none.

Response

filename, type, encoding (always base64) and content. 404 easy_svg_pro_no_original when there is none.

{
  "filename": "logo-original.svg",
  "type": "image/svg+xml",
  "encoding": "base64",
  "content": "PHN2Zy4uLg=="
}
The decoded content is the unsafe original. Do not serve it from your site or put it back into uploads.