Can I add or update workflow content via API?
Yes, you can add or update content in an approval workflow using a relevant endpoint.
Procedure
First, create an empty workflow with no changes to the content. For a detailed guide on how to do this, see Tutorial: Scheduling updates for published contents.
Next, create an endpoint for updating the content with the following settings:
Setting | Value |
---|---|
Category | Content |
Model | Topics, v1 |
Operation | update(*) |
topics_group_id | (Enter the target topic group ID / content structure ID) |
*Note: To create a new content post via API, select [insert] instead of [update] as the "Operation" setting.
In the Swagger UI, try out your endpoint with the content to be updated in the request body.
{
"subject": "Kuroco updates - November 2022",
"contents": "The official version has been released! For more details, visit our official website.",
"open_flg": 1,
"ymd": "2022-11-08",
"approvalflow_id": 2
}
Make sure to substitute your own approval workflow ID into "approvalflow_id": 2
.
You should see the updates reflected in the content, pending approval.
(If you modified the title/subject of the post, the old title will appear in parentheses.)
To publish the updates, simply approve the workflow as usual.