Workflow - HTTP REQUEST

Looks like the API will return a 404 instead of an empty tags array if you are looking for an object that doesn’t have any tags. Workflows doesn’t yet have the ability to handle non 2xx response codes from the HTTP request, so you can’t catch the 404 and deal with in a comparison operator.

However, you can use the filters query param to search for a tagged object that matches the campaign ID, and if none exists it will return an empty array. Use this endpoint instead, replacing {campaignId} with your ID.

{{baseUrl}}/beta/tagged-objects?filters=objectRef.id eq "{campaignId}"

If that object has any tags, it will return an array with one item:

[
    {
        "objectRef": {
            "type": "IDENTITY",
            "id": "2c9180867dfe6951017e208e327c5ae3",
            "name": null
        },
        "tags": [
            "STARTS_WITH_A",
            "RISKY"
        ]
    }
]

If that object doesn’t have any tags, it will return an empty array:

[]

Check the length of the array using the Compare Numbers operator with this JSONpath:

$.length()

If it’s greater than 0, then your object has a tag, otherwise it doesn’t have a tag.

2 Likes