MyMautic: 5.0.2 (VPS)
MyPHP Server: 8.1
MyPHP local 8.2.
I am using a php script to retrieve a mail with the Rest API. The code worked fine with Mautic 4.x. However, I am trying to use it on my Mautic 5.0.2 and unfortunately all I get as result is an empty email array
Are there known issues with the Rest API in Mautic 5? Or did I miss something, which I need to consider now in contrast to Mautic 4?
Yeah, that is generally a good idea to check. Unfortunately, I tried mails and users without succes, both arrays are empty even though there are some entries in the database.
Is there anybody who already uses the API with PHP in Mautic 5? (I am pretty sure, I miss something but I am confused since my code is working fine with Mautic 4 but not with Mautic 5)
I’m having the same issue after upgrading to Mautic 5 from Mautic 4.
A quickfix for the moment is to disable setting of the serializer groups in Line 679 of app/bundles/ApiBundle/Controller/FetchCommonApiController.php. I just commented out this single line here. Now the returned entities are pretty large but it is a quickfix that works for me at the moment.
if (!empty($this->serializerGroups)) {
// $context->setGroups($this->serializerGroups);
}
Would highly appreciate a hint to a complete fix. I don’t understand where the relation between serializer group and fields that should be serialized is defined as I didn’t find any annotations on the entities.