Your software
My Mautic version is: 3.2.2
My PHP version is: 7.4
My Database type and version is: 8.0.18
Your problem
I’m trying to use the API to create an email and schedule it to send and most things are working except two. For now, I’m just using Postman to do this so I can get the structure right before coding it into the system that will be generating the email contents. There are two fields, however, that I just cannot get to work, these are isPublished
and category
.
isPublished
is a boolean, so I’ve tried true
and 1
but the field is always set to false
in the response and when viewed in the Mautic interface.
category
says its type is “object” and I’ve tried passing all manner of things in that field, but the only thing I’ve found that partially works is to set the key to category[]
as you do for an array and whilst this then sets a category, it always sets it to the value of category ID 1. I’ve tried category[0]['id']
and category['id']
as well, with the value set to other valid ID’s, e.g. 3, 4, 5, etc… but it always just sets it to 1.
Can someone please point me in the right direction or maybe to a guide as to how the API excepts none string values to be passed (I only found out about the array one from another forum post about the lists
value). I’m thinking it might be a PHP specific thing as I’m not all that familiar with PHP and Mautic is build on PHP, so I guess it is how PHP expects the values to be passed in the POST data.
Thanks.
Andrew.