Custom Objects - how to use API with a custom object type "Relationship"

Hi Folks,

Custom Objects are great! But I can´t find a way to create a Relationship item using the API. The example provided in the docunentarion refers to a master custom object:

I need to create a Relashionship linked to the contact AND to the Mater Custom Object. Can you please provide an example? @rcheesley have you ever faced this use case?

Best regards

We would love to know this too - we gave up after a few days…

1 Like

I do not think its possible at the moment (at least not using standard CO api endpoints).

I would suggest you look into how the link is made in CO plugin and then develop custom plugin with dedicated endpoint for it. At this point it seems the fastest way.

I did something similar in my situation.

I would however really appreciate this feature within CO plugin, so if/when its possible, please do not hesitate to share (Core Mautic Team).

@escopecz @fedy any insights that you can offer here?

The only API that works is the one linked at the top. We have a “v2” of API built on API Platform for Custom Objects but even that does not allow to create relationships. I know, it should, but so far no customer of ours needed it.

The API Platform will be pushed to the community GitHub repository at some point but since the lack of active testers and that open pull requests are sitting there for months and years it’s discouraging to push any more pull requests to the community. I’m ranting about this as I hop this will make more people active testers so the developers are not discouraged to push new features and bug fixes to the community repository. Right now it’s a waste of time.

2 Likes

This is such a pity that you cannot create a relationship item yet.

As stated custom objects are amazing - super powerful and thanks to all that created it.

Is there any plans to continue developing the API and extending functionality ?

2 Likes

There is no plan to extend the API in the foreseeable future from our side. But I’ll gladly test and review any community contribution on this topic!

Hello @escopecz,

Can you confirm me this route " PATCH/PUT api/contacts/[contact_id]/edit" (API · acquia/mc-cs-plugin-custom-objects Wiki · GitHub) is working ?

I have been doing a lot of tests with no results. Impossible to create “custom object” from API…

Can you help us?
Pierre

I think this feature is not available. You can’t pair vis API.

Yes, our customers are using it. There are also tests that are confirming that it is working mc-cs-plugin-custom-objects/Tests/Functional/EventListener/ApiSubscriberTest.php at 3593179ae431e343179da25371d4df03617ec522 · acquia/mc-cs-plugin-custom-objects · GitHub

But it won’t create custom objects. It can create custom items and link them with the contact.

does anybody managed to use it this plugin in mautic 5?
i’ve tested all versions and with no success… i’m using mautic 5.1

@rcheesley, custom objectds will be compatible with mautic 5.x ? I am just using this plugin because it was published from Acquia

I don’t know, but I would recommend you follow this PR as I’m guessing that’s the most likely place to receive updates and help with testing:

Thank you! But tis PR will include customobjects? This is a pluggin…