Upload an attachment
Body
-
parent integer
Parent object ID.
-
parent_model string
Parent model name (e.g.
user
). -
parent_field string
Parent model field (e.g.
image
). -
file string(file)
File contents.
POST
/attachments
curl \
-X POST /wp-json/hivepress/v1/attachments \
-H "Content-Type: application/json" \
-d '{"parent":42,"parent_model":"string","parent_field":"string","file":"string"}'
Request example
{
"parent": 42,
"parent_model": "string",
"parent_field": "string",
"file": "string"
}
Request examples
{
"parent": 42,
"parent_model": "string",
"parent_field": "string",
"file": "string"
}