I've figured out the basics of how to use a simple POST request to create a new Drupal 8 node. For example, using the JSON:API:
https://www.drupal.org/docs/8/modules/jsonapi/creating-new-resources-post#basic-post-request with a payload that looks like:
{
"data": {
"type": "node--article",
"attributes": {
"title": "My custom title",
"body": {
"value": "Custom value",
"format": "plain_text"
}
}
}
}
However, in my case I have no control over the payload, and need to create a new node from a JSON post request that looks like so instead:
{
"title": "My title",
"message: "My Message",
}
The documentation and available examples for accepting POST requests I'm finding so far are few and far between, so just wondering if anybody has any guidance or examples to share.
I'm assuming we will need to implement a custom module of some sort to serialize/denormalize the payload, but the more I read the more I'm unclear about how to approach this or what exactly we need to implement. It has been a long day, and I'm just looking for the simplest approach to accepting a POST request like this to create a simple node :)
Thanks for any guidance -- Tim