GET masters/{id}/target

Overview

This resource reads the targeting for a message master. A newly created master will have no targeting.

Resource URI

 https://api.yesmail.com/v2/masters/{id}/target

Call Description

The GET /v2/masters/{id}/target reads the current targeting of a message master.

HTTP Return Codes

Code

Description

200 OK

Returned when the master ID exists, the payload will have the master's targeting section only.

401 Unauthorized

The request requires user authentication.  Invalid Api-User and/or Api-Key header value.

404 Not Found

The target has not been set, master ID cannot be found, may not exist for the given Api-User or is archived.

Response

Complex target with most targeting parameters used.

{
    "segments": [
        {
            "profile": {
                "hasEmail": true
            }
        },
        {
            "subscription": {
                "status": "subscribed"
            }
        },
        {
            "attribute": {
                "name": "NumberRange",
                "values": [
                    "range1"
                ],
                "nextOp": "and"
            }
        },
        {
            "attribute": {
                "name": "Num",
                "values": [
                    "30 - "
                ],
                "nextOp": "and"
            }
        },
        {
            "group": {
                "segments": [
                    {
                        "action": {
                            "type": "opened",
                            "masterIds": [
                                {
                                    "masterId": "1252953"
                                }
                            ],
                            "nextOp": "or"
                        }
                    },
                    {
                        "attribute": {
                            "name": "Domains",
                            "values": [
                                "bright.net",
                                "austin.rr.com"
                            ],
                            "negate": true
                        }
                    }
                ],
                "nextOp": "and"
            }
        },
        {
            "attribute": {
                "name": "CUST_DATE_ATTR",
                "values": [
                    "2015-05-24T07:00:00.000Z/2015-05-30T07:00:00.000Z"
                ],
                "nextOp": "and"
            }
        },
        {
            "isMemberOfList": {
                "lists": [
                    "April list"
                ]
            }
        }
    ]
}