Create custom object via API (with own id for the object)?

Hello,

as described at API · acquia/mc-cs-plugin-custom-objects Wiki · GitHub a new custom object can be created via the api using the edit-endpoint of the contact-api adding data for the custom object in it.

For example:

/contacts/342157/edit

{
    "customObjects": {
        "data": [
            {
                "id": 1,
                "alias": "jobPosting",
                "data": [
                    {
                        "name": "Job Neu - über die API erstellt"
                    }
                ]
            }
        ]
    }
}

In this case the new custom object is created and assigned to the contact.

But is it also possible to create an custom object without assigning it to an contact?

And is the a way to create a custom object and passing an own id for the object?

Because an important thing I have to handle via api is to update an existing custom object. But in best case I don’t want to store the custom object id in my system. I would prefer to set an own id as id for the custom object. But is this possible? In text and screenshots at Custom objects — Acquia Docs it looks like there is a way to define own unique identifier. But in my system there is no such option.

Thanks for some help/feedback about this!

Best regards,

Timo

1 Like