Hi, i’m exploring the Php Library to integrate mautic api with a custom application.
I’m able to retrieve the contact data and now i want to create a contact but i can’t find a method to assing the new contact to a segment.
this is the code for create the contact
$data = array( 'firstname' => $firstname, 'lastname' => $lastname, 'email' => $email, 'ipAddress' => $_SERVER['REMOTE_ADDR'], 'overwriteWithBlank' => true, ); $contact = $contactApi->create($data);
to add the contact to the segment, i need the ID of the contact just inserted or is there a way to do it contextually?