API for campaigns broken?

I experimented a bit with the API to create campaigns.

I used the data JSON of an existing one and send it to the API. The new campaign was created, but:
1.) all the nodes of the campaign ended up top left on the canvas (they still have the x,y coordinates, when I read the just created campaign via the API),
2.) they were not connected, although I send the “connections part” via API JSON payload (that is still inside the JSON payload when I read it again).

I wonder what the:

  • campaignID within some events (long random string starting with “mautic_”) and sometimes the real short campaignID, and
  • “_token” fields are used for and how they are generated.

Not supplying them ends up with error 400 trying to create the campaign.

Did someone successfully create a new campaign via API in the past? How did Maestro(?) do it - was it via API or via a Plugin with direct database access?

Hmm. Works for me. If the json is fine, it should show properly.

Mhm, the problem is, the API doesn’t tell much about what went wrong…
How do you know that the JSON is fine?

So when you do it, the connections / links are working and the node don’t end up top left?

I have the same issue. Was you able to figure anything out how this works?

Okay I might have it figured out. I am doing all of the connections using N8N, What i noticed was the connections array was not matching up with the event IDs due to mautic setting them, so what I did was add a Patch node and edit the campaign an update the source and target ids. I will publish a N8N campaign once i am done

I have the same problem. Has anyone figured out how to resolve this? Is there an example json?