Re: How to differentiate Tentative/Confirmed/Finished events via api

testEIk
Level 1

How to differentiate Tentative/Confirmed/Finished events via api

Hi Everyone, Long time reader, first-time poster. I see that event program is Tentative by default, then it can be Confirmed manually and once it's passed - Finished. But via Get program by Id  endpoint I see no difference in response among these three statuses. Any ideas how to check what status event program is in please?

3 REPLIES 3
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How to differentiate Tentative/Confirmed/Finished events via api

I don't think that's something you could query programmatically via API, but curious as well to see if there's a way after all.

AWmindtree
Level 4

Re: How to differentiate Tentative/Confirmed/Finished events via api

Hi @testEIk 

Very interesting question, that made to test this one. Here is something I got:
Use Endpoint: GET rest/asset/v1/program/byName.json?name=Test Webinar&includeTags=true
You'll get the below response:

{
    "success"true,
    "errors": [],
    "requestId""XXXXXXXXXX",
    "warnings": [],
    "result": [
        {
            "id"1196,
            "name""Test Webinar",
            "description""",
            "createdAt""2023-06-22T11:30:32Z+0000",
            "updatedAt""2023-07-07T12:28:50Z+0000",
            "url""https://app-ab35.marketo.com/#ME1196A1",
            "type""EventWithWebinar",
            "channel""Webinar",
            "folder": {
                "type""Folder",
                "value"XXX,
                "folderName""XXXXXXX"
            },
            "status""",
            "workspace""Default",
            "tags": [
                {
                    "tagType""XXXXX",
                    "tagValue""XXX"
                }
            ],
            "costs": [],
            "startDate": "2023-07-02T00:54:00.000Z",
            "endDate": "2023-07-06T00:54:00.000Z"
        }
    ]
}

These Start End and End Date values gives you the Start and End Date of the Event. If your End Date is in future that means Event is not ended and if it is past, then it is finished. 
Note- 1. Start Date and End Date should be present in the Event, else it will not show you startDate and endDate in API response
2. This timezone is in CDT by default, so you need to convert them to your local time/ Marketo instance time. For example. I had Start date as 1st July 2023 and End Date as 5th July 2023 and Time 5.54 PM but it returns 2nd July and 6th July in the response. 

Hope this helps 🙂

Regards
Ankit
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How to differentiate Tentative/Confirmed/Finished events via api

Yes, but I believe OP is trying to see if there's a way to GET the status of the event set in the Marketo > Event > Schedule tab > Status (Tentative, Confirmed, or Finished). This status is something that users can set in-addition to the event start and end date that the GET Program API endpoint returns (e.g., an event could have start and end dates, but their status might be Tentative/Confirmed/Finished). Here's documentation regarding it on the experience league. See the snapshot below:

Darshil_Shah1_0-1688738384796.png