首页 > 解决方案 > Eloqua's update event API endpoint overwrites instead of updating

问题描述

I'm writing a script that will hit the Eloqua API to add a new sessions to an event as per the docs here. I'm using the endpoint /api/REST/2.0/assets/eventRegistration/{id} from the docs and doing a put request that looks like this:

{
    "type": "EventRegistration",
    "id": "131",
        "sessions": [
        {
            "type": "EventSession",
            "id": "46",
            "name": "TEST+PUT+SESSION"
        }
    ]
}

But that request overwrites the event and deletes any other sessions that already exist. Is there a way to tell the api to just add a new session and not overwrite or do I need to do a get request first and then a put?

标签: eloquaeloqua-bulk-api

解决方案


All existing sessions are required when adding new sessions, so you will need to retrieve all sessions to include existing sessions in the PUT.


推荐阅读