Cannot create a workflow through API
I'm using the code in my app:
$novu = new Novu(<NOVU_API_KEY>);
$novu->createNotificationTemplate([
[
'name' => 'new_seller_admin_notify',
'notificationGroupId' => '65d88e638b742c73124b6c23',
'active' => true
'preferenceSettings' => [
'email' => true,
'sms' => true,
'in_app' => true,
'chat' => true,
'push' => true,
],
'steps' => [
[
'template' => [
"title" => "wellness_course_started_title",
"content" => [
[
"type" => "text",
"content" => "Hello admins!<div>New seller has been registered!</div><div>Name: {{name}}</div><div>Email: {{sellerEmail}}</div>",
"styles" => [
"textAlign" => "left"
]
]
],
"type" => "email",
"subject" => "New Seller",
"contentType" => "editor",
"senderName" => "Le Paniew Blue",
"variables" => [
[
"name" => "name",
"type" => "String"
],
[
"name" => "sellerEmail",
"type" => "String"
]
]
],
],
]
]
]);
I am getting an error:
[2024-02-23 12:49:49] local.ERROR: [NovuService]:createNotificationTemplate ["{"message":["active must be a boolean value"],"error":"Bad Request","statusCode":400}"]
BUT, I set 'active' => true.
10 Replies
@Sapar, you just advanced to level 3!
If remove the parameter 'active' => true, the workflow is created succesfully, but it is INACTIVE, so I need to open my web-dashboard and activate it manually.
@Sapar did you try sending false value to
active
fieldYes I tried @Pawan Jain . The same error.
[2024-02-26 07:13:40] local.ERROR: [NovuService]:createNotificationTemplate ["{"message":["active must be a boolean value"],"error":"Bad Request","statusCode":400}"]
@Sapar I see api is working as expected
Let me check if there is some issue in SDK
Is above code for laravel/php sdk?
@Pawan Jain , no, this is for use Novu\SDK\Novu;
"unicodeveloper/novu": "^1.1"
Can anyone help with that?
@unicodeveloper
Could you please help us
Could you please help us
@Sapar @Pawan Jain I will check that this morning
It should work as intended. Give me some time to double check
Is it possible to fix?
?
I just confirmed that this is indeed happening
I am trying to see what's wrong
Because the whole data payload is simply been passed to the API