ad/plan

Update, or get information about, an Ad Targeter Plan.

Endpoint URL: https://api.sailthru.com/ad/plan
GET Mode Retrieve information about Ad Targeter plans.

Get All

Example Call (Empty Object):
{}

 

Show Example Response

 

{ "ad_plans" : [
        {
            "plan_id" : "55e5e9153c8aa90d338b4570",
            "name" : "1Demo",
            "list" : "Me",
            "schedule" : [
                "Tue",
                "Wed"
            ],
            "zones" : [
                {
                    "name" : "NJ",
                    "width" : 300,
                    "height" : 200
                },
                {
                    "name" : "NY",
                    "width" : 300,
                    "height" : 200
                }
            ]
        },
        {
            "plan_id" : "5548c7a5bd40d7c07211a990",
            "name" : "4238Adplans",
            "list" : null,
            "schedule" : [
                "Mon",
                "Tue",
                "Wed",
                "Thu",
                "Fri",
                "Sat",
                "Sun"
            ],
            "zones" : [
                {
                    "name" : "Connecticut",
                    "width" : 772,
                    "height" : 168
                },
                {
                    "name" : "Georgia",
                    "width" : 772,
                    "height" : 168
                },
                {
                    "name" : "Illinois",
                    "width" : 772,
                    "height" : 168
                },
                {
                    "name" : "NewYork",
                    "width" : 772,
                    "height" : 168
                },
                {
                    "name" : "NorthCarolina",
                    "width" : 772,
                    "height" : 168
                },
                {
                    "name" : "Pennsylvania",
                    "width" : 772,
                    "height" : 168
                },
                {
                    "name" : "Tennessee",
                    "width" : 772,
                    "height" : 168
                },
                {
                    "name" : "Texas",
                    "width" : 772,
                    "height" : 168
                }
            ]
        },
       ...
    ]
}

By Plan Name

Example call:
{
    "name" : "new adplan"
}
Result:
{
    "plan_id" : "582a0c191aa312a11a8b456a",
    "name" : "new adplan",
    "list" : null,
    "schedule" : [],
    "zones" : []
}

Optional Parameters

Note: If no name specified, the call will return all plan names as an array
Parameter Description Example
name Plan Name New York Weekdays

Return Value

Will return a data structure including some or all of the following information:
Field Description Example
name Name of plan New York Weekdays
list List associated with plan New York - Main
schedule Days of week the plan runs ['Mon','Tue','Wed','Thu','Fri']

POST Mode

Create or update an Ad Targeter plan

Call Example

{
    "name" : "NatureApiTest",
    "list" : "Me",
    "schedule" : [
        "Mon",
        "Tue",
        "Fri",
        "Sat",
        "Sun"
    ],
    "zones" : [
        {
            "name" : "nature",
            "width" : 259,
            "height" : 194
        }
    ]
}

Response Example

{
    "plan_id" : "5829f6a9e9328b5e5c8b482e",
    "name" : "NatureApiTest",
    "list" : "Me",
    "schedule" : [
        "Mon",
        "Tue",
        "Fri",
        "Sat",
        "Sun"
    ],
    "zones" : [
        {
            "name" : "nature",
            "width" : 259,
            "height" : 194
        }
    ]
}
The object is returned with the added plan_id.

Required Parameters

Parameter Description Example
name Plan Name New York Weekdays

Optional Parameters

Parameter Description Example
list List associated with plan New York - Main
schedule Array of the days of week the plan runs ['Mon','Tue','Wed','Thu','Fri']
schedule_days Object of specific days to include/exclude from the schedule {"20120214":1,"20120215":-1}
zones Array of the zones within the plan See below

schedule_days parameter

schedule_days should be an associated array of days, where the key is in YYYYMMDD format, and the value is either:
  • 1, meaning "include this day"
  • -1, meaning "exclude this day"
  • 0, meaning, "don't apply any special rules to this day"
This is useful for scheduling irregular schedules, one-off sends, or removing specific days (such as holidays) when you do not plan to send.

zones parameter

zones should be an array of zones, where each element contains the following:
Field Description Example
name Name of the zone header
width Width of the zone 728
height Height in pixels of the zone 90

DELETE Mode

Delete a plan

Example Call

{
"name" : "old adplan"
}

Required Parameters

Parameter Description Example
name Plan name to delete New York Weekdays

Contact us

Top