Download every file the batch references as one zip, entries named to match the src paths in the records.
/docs/api/media.txtPOST https://api.pixydesignapp.com/tasks/{id}/media.zip
Download every file the batch references, as one zip. A record names a file as media/<file>, in its snapshot markup, in a change's src or html, or in a style's url() such as background-image, and does not carry the bytes, so this is how the bytes arrive.
Entries in the zip are named media/<file>, exactly the paths in the records. Unpack it next to the markup and the paths resolve, then serve the files from the site's own origin.
Without an id (POST /tasks/media.zip) it answers with the media of every open record.
Header: X-Pixy-Key carrying the agent key (px_sk_…).
Body: none.
Response: the zip itself, application/zip, not JSON. Give curl an -o.
Errors: JSON, as everywhere else.
| error | when |
|---|---|
invalid_key |
The key is not one of the project's, or was retired. |
no_media |
The batch references no files. |
Examples:
curl -X POST https://api.pixydesignapp.com/tasks/9f1c2e40-7b3a-4d51-9a2e-2c8f0b6d1a77/media.zip \
-H 'X-Pixy-Key: px_sk_yourkey' \
-o media.zip
curl -X POST https://api.pixydesignapp.com/tasks/media.zip \
-H 'X-Pixy-Key: px_sk_yourkey' \
-o media.zip