Hello,
I’m trying to add events with featured images via the v1 REST API but I am getting an error. I have the media uploaded to my wordpress site already, so I’m trying to link to that media. I couldn’t find any documentation on this process, so I used a GET request on an existing post to figure out the structure, and came up with this:
{
"id": 224,
"image": {
"url": "https://wp.example.org/wp/content/uploads/2023/11/image.jpg",
"extension": "jpg"
}
}However, any time I use the “image” structure in my POST body I get a 400 error back saying that “image” is an invalid parameter. I have tried many combinations of settings underneath “image”, but I always get the same error, so it appears to not like that container.
{
"code": "rest_invalid_param",
"message": "Invalid parameter(s): image",
"data": {
"status": 400,
"params": {
"image": "Invalid parameter."
},
"details": []
}
}Is it possible to set images using the REST API? Could somebody point me in the right direction?
