Skip to content

Commit d09c942

Browse files
committed
Update README.md
1 parent 6a4cfab commit d09c942

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ echo "PREPARING STORY CONTENT DATA..." . PHP_EOL;
766766
$content = new StoryComponent("article-page");
767767
$content->set("title", "New Article");
768768
$content->set("body", "This is the content");
769-
$content->setAssetField("image", AssetField::makeFromAsset($assetCreated));
769+
$content->setAsset("image", $assetCreated);
770770

771771

772772
echo "INITIALIZING STORY OBJECT..." . PHP_EOL;
@@ -992,7 +992,8 @@ foreach ($changes as $key => $change) {
992992

993993
### Creating a new workflow stage change
994994

995-
To create a new workflow stage change, you can use the `create` method:
995+
If you need to move a story to a specific workflow stage (using the workflow stage identifier), you must create a new stage change, for example, when moving a story from *Drafting* to *Reviewing*. To create a new workflow stage change, you can use the `create()` method:
996+
996997
```php
997998
$storyId = 12345;
998999
$workflowStageId = 54321;
@@ -1007,6 +1008,11 @@ $changeDataResponse = $changesApi->create(
10071008
);
10081009
```
10091010

1011+
According to the structure of the Management API, when creating a new workflow stage change you can set the following parameters directly in the create method.
1012+
- `WorkflowStageChange::makeFromParams()`: defines the stage change payload, including the story ID, target workflow stage ID, and optional attributes such as a due date.
1013+
- `commentMessage`: a text message added to the stage change, useful for providing context or reviewer instructions.
1014+
- `notify`: a boolean indicating whether Storyblok should send notifications to users associated with the workflow stage.
1015+
10101016
## Using the `ManagementApi` class
10111017

10121018
To illustrate how to use the `ManagementApi` class, we will demonstrate its usage with the Internal Tags endpoint.

0 commit comments

Comments
 (0)