Problem with API - Add to Segment

Your software
My PHP version is : 7.2.31
My MariaDB version is: 10.4.13

Updating/Installing Errors
I am: Updating
Upgrading/installing via : Command Line

These errors are showing in the Mautic log : None

My problem is :

Hi, i use Mautic as a e-mail marketing automation in Hotmart (it’s a Brazilian company that hosts and sell online courses).

I recently updated my Mautic to 3.0.1 and I’m facing problemas with the Hotmart API.

There’s a tool called ListBoss, that connects to a lot of e-mail automation tools (as Mautic) and send contacts infos, for example:

If a contact has a status of “Abandoned Cart” or “Payment Error” or “Purshace Done”, they create this contact to me and send it to a new segment.

After the upload, ListBoss can still create the new Contact, but it’s doesn’t add the contact to my Segment.

Their API can even show a list of all segments available, but can’t add on it…

When i talked with Hotmart they told me that Mautic didn’t changed anything on it’s API in version 3.0, so it’s must be an error with My Mautic.

Is it true? Did Mautic changed anything regarding it’s API to create a new contact and add it to a segment?

PS: Just to be sure, that’s a two step process:

  • Creates a new user
  • Add it to a segment

Hotmart can still create the user (that’s why they told me that the API isn’t the problem and did not changed anything from 2.x to 3.0). But ListBoss can not add this contact to any segment

Steps I have tried to fix the problem :

I’ve tried:

  • Create a new OAUTH 2 credentials.
  • Create a new account on ListBoss.
  • Disable/Enable the API.
  • Recreate all the segments.

Anyone can help me, please?

The question is simple: Did Mautic changed anything on API to ADD Contact to Segment in Mautic 3.0?

I had the same issue today,

It was solved by clearing / warming up the cache on mautic
see documentation for reference: Troubleshooting | Mautic

1 Like

Hello, how do you put a contact in a segment via api?

I use webinarpress and it connects with mautic via api, it sends the contact BUT IT DOESN’T SEND IT TO ANY SEGMENT, I don’t know how to do it.

Hi, via API you can use the following call in php:

POST /segments/SEGMENT_ID/contacts/CONTACT_ID/add

The info seems off here:
CONTACT_ID is missing:
https://developer.mautic.org/#add-contacts-to-a-segment

1 Like

hello!

Thank you for answering my message. Thank you so much.

I’ll see if I can but I don’t handle php so it will be very difficult :frowning:

But what I thought to do is:
Create a segment and in filters choose “visited url” and it is equal to or contains

Maybe this will work…

Why do I think it can work? Well, because when you register you go to a thank you page created by webinarpress.

With what webinarpress when registering sends the contact to mautic and the contact if or if you visit the url of thanks for registering to the webinar since it is automatically redirected, then “you would have to enter the segment” since you visited the url…

do you think that is an option?

Thank you.

Hi, you are welcome.
Your idea would work. Since you use wordpress you can also use the WP Mautic plugin and add tags on different pages with the help of the following shortcodes:

MAUTIC TAGS

You can add or remove multiple lead tags on specific pages using commas. To remove an tag you have to use minus “-” signal before tag name:

[mautic type="tags" values="mytag,anothertag,-removetag"]

Thanks for the reply.

I have the plugin installed, and there is no where to put that tag.
Basically the plugin screen is this:

so there is no where to put labels.
I have looked at the documentation and it talks about labels but it does not say where to put them

I have created a page in wordpress to see if in the creation of the page a field appears to put the label and it does not appear either.

so I don’t know where to put the label,
joey did you ever use the plugin to insert a tag?

By the way, the webinarpress plugin in the webinar subscription confirmation page configuration has a script tags section:

Do you think it is created to be able to put “labels” as for example in my case?

Thanks for the support @joeyk You help me a lot to overcome my obstacles

Hey,

Can you edit the page with the Gutenberg builder (What is visual Editor?)?
If yes, then you can add the shortcode there, just like any WP shortcode.
I can see, that you can add a custom thank you page. It seems like a good way to go.

If not, then I have one more idea. BTW - did you add the Mautic tracking to the header of the page in WP? Tracking works?
Let me know.

Hello
yes, it is possible but unfortunately the shortcodes of the webinarpress plugin do not work, I tried all the ways and they always came out:

The time you chose is the following:

[webinarpress_confirmation_stars_at format=”D MMM YYYY HH:mm”]

more text here

[webinarpress_confirmation_stars_at format=”D MMM YYYY HH:mm”]

that is, if you make a custom page it does not work.

but if I use the one that brings those shortcode by default, it shows the information such as the name of the webinar, the date of the webinar and the link and button to the webinar

con lo que creo que está descartada esa opcion :frowning:

On the other hand, I have realized (I made several test records) that it sends the contact to mautic but the name is the email, that is, it does not collect other fields… this is a bit strange, right?

I forgot to put the tag:

and it doesn’t work either, mautic doesn’t collect subscribers with that tag

Gracias.

No… it doesn’t work this way.

Can you plz open a new thread, cause we are offtopic here.

for anyone else struggling… it’s “contact” not “contacts” and it needs to be sent as a POST explicitly.
https://YOURMAUTICURL.com/api/segments/SEGMENT_ID/contact/CONTACT_ID/add

1 Like