Schedules

Schedule pass updates for future delivery.

Delete schedule

Deletes the specified schedule.

Jump to examples ↓

DELETE /schedules/{projectId}/{scheduleId}

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values: 1.2

Path parameters:

  • projectId stringREQUIRED
    The project ID.
  • scheduleId stringREQUIRED
    The schedule ID. This is appended to the end of the url in the response for schedule operations.

Responses

  • 204

    A deleted schedule returns no content.

Examples

Example request

DELETE /v1/schedules/12345/3b13666df-e5b3-4e42-8919-f8d63bd7ce2a HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

Response

HTTP/1.1 204 No Content

Get schedule

Return a single project’s schedule.

Jump to examples ↓

GET /schedules/{projectId}/{scheduleId}

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values: 1.2

Path parameters:

  • projectId stringREQUIRED
    The project ID.
  • scheduleId stringREQUIRED
    The schedule ID. This is appended to the end of the url in the response for schedule operations.

Responses

  • 200

    Returns a single schedule object.

    • Content-Type: application/json

      Specifies updates to passes or adaptive links at a particular date and time.

Examples

Example request

GET /v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "name": "New Offer Update",
  "schedule": {
     "scheduled_time": "2017-04-10T18:45:00"
  },
  "update": {
     "audience": {
        "tag": "TZ_ET"
     },
     "pass": {
        "fields": {
           "primary1": {
              "value": "$20 Off"
           },
           "secondary1": {
              "value": "Mega Offer"
           }
        }
     }
  }
}

List schedules

Get a list of all schedules that have not yet occurred for the project.

Jump to examples ↓

GET /schedules/{projectId}

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values: 1.2

Path parameters:

  • projectId stringREQUIRED
    The project ID.

Responses

  • 200

    Returns a list of schedules, ordered scheduled_time closest to the present.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • count integer

        The number of schedules on the page.

      • next_page string

        The URL of the next page in the result set.

      • ok boolean

        If true, the operation completed successfully.

      • schedules array

        The list of upcoming schedules.

      • total_count integer

        The total number of schedules.

Examples

Example request

GET /v1/schedules/12345 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "count": 2,
   "next_page": "https://wallet-api.urbanairship.com/v1/schedules/12345?start=5c69320c-3e91-5241-fad3-248269eed104&limit=2&order=asc",
   "ok": true,
   "schedules": [
      {
         "schedule": {
            "scheduled_time": "2017-04-10T18:45:00"
         },
         "update": {
            "audience": {
               "tag": "TZ_ET"
            },
            "pass": {
               "fields": {
                  "primary1": {
                     "value": "$20 Off"
                  },
                  "secondary1": {
                     "value": "Mega Offer"
                  }
               }
            }
         },
         "url": "http://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109"
      },
      {
         "schedule": {},
         "update": {},
         "url": "http://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed10A"
      }
   ],
   "total_count": 4
}

Schedule an update or push notification

Schedule an update to a project or schedule a notification to a project.

Jump to examples ↓

POST /schedules/{projectId}

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values: 1.2

Path parameters:

  • projectId stringREQUIRED
    The project ID.

Request body:

The schedule update object to schedule an update or the schedule notification object to schedule a notification.

  • Content-Type: application/json

    One of
    • Specifies updates to passes or adaptive links at a particular date and time.

    • Schedule Notification Object object

      Specifies notifications to passes or adaptive links at a particular date and time.

      OBJECT PROPERTIES
      • name string

        A name for the schedule.

      • notify object

        The notification you want to send to an audience or pass, generated from a template within the project. Cannot be used with the update object present as well.

        OBJECT PROPERTIES
        • audience object<Audience selector>

          Determines the passes you want to target.

        • pass object
          OBJECT PROPERTIES
          • notification object

            An object for sending a custom pass notification message.

            OBJECT PROPERTIES
            • label string

              Optional header for the message.

            • value stringREQUIRED

              The body of the notification message.

      • schedule object
        OBJECT PROPERTIES
        • scheduled_time string

          The ISO 8601 inclusive date, optionally including an offset, e.g., 2007-03-01T13:00:00+08:00. The value will be converted and stored as UTC.

        • url string

          A URL to get the schedule object.

Responses

  • 200

    Returns the schedule request along with identifiers for the operation and the schedule itself.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • ok boolean

        If true, the operation completed successfully.

      • operation_id string

        Identifies the operation for troubleshooting and logging.

      • schedule_urls array[string]

        URLs for the schedules created by the operation. Items in the array are ordered just as they were in the request.

      • schedules array

Examples

Example request for update

POST /v1/schedules/12345 HTTP/1.1
Authorization: Basic <Base64 key>
Content-Type: application/json
Api-Revision: 1.2

{
   "name": "New Offer Update",
   "schedule": {
      "scheduled_time": "2017-04-10T18:45:00"
   },
   "update": {
      "audience": {
         "tag": "TZ_ET"
      },
      "pass": {
         "fields": {
            "primary1": {
               "value": "$20 Off"
            },
            "secondary1": {
               "value": "Mega Offer"
            }
         }
      }
   }
}

Response for update

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "ok": true,
  "operation_id": "efb18e92-9a60-6689-45c2-82fedab36399",
  "schedule_urls": [
     "https://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109"
  ],
  "schedules": [
     {
        "url": "https://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109",
        "ticket": "https://wallet-api.urbanairship/v1/ticket/6789",
        "name": "New Offer Update",
        "schedule": {
           "scheduled_time": "2017-04-10T18:45:00"
        },
        "update": {
           "audience": {
              "tag": "TZ_ET"
           },
           "pass": {
              "fields": {
                 "secondary1": {
                    "value": "Mega Offer"
                 },
                 "primary1": {
                    "value": "$20 Off"
                 }
              }
           }
        }
     }
  ]
}

Example request for notification

POST /v1/schedules/12345 HTTP/1.1
Authorization: Basic <Base64 key>
Content-Type: application/json
Api-Revision: 1.2

{
   "name": "New Offer Update",
   "schedule": {
      "scheduled_time": "2017-04-10T18:45:00"
   },
   "notify": {
      "audience": {
         "tag": "TZ_ET"
      },
      "pass": {
         "notification": {
            "label": "Last Notification",
            "value": "20% off any one regular priced item"
         }
      }
   }
}

Response for notification

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "ok": true,
  "operation_id": "efb18e92-9a60-6689-45c2-82fedab36399",
  "schedule_urls": [
     "https://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109"
  ],
  "schedules": [
     {
        "url": "https://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109",
        "ticket": "https://wallet-api.urbanairship/v1/ticket/6789",
        "name": "New Offer Update",
        "schedule": {
           "scheduled_time": "2017-04-10T18:45:00"
        },
        "notify": {
           "audience": {
              "tag": "TZ_ET"
           },
           "pass": {
              "notification": {
                 "label": "Last Notification",
                 "value": "20% off any one regular priced item"
              }
           }
        }
     }
  ]
}

Update schedule

Update a schedule. The payload to update a schedule is identical to the request to create a schedule.

Jump to examples ↓

PUT /schedules/{projectId}/{scheduleId}

Request headers:

  • Api-Revision stringREQUIRED
    The particular API revision you want to use. In general, this is 1.2.

    Possible values: 1.2

Path parameters:

  • projectId stringREQUIRED
    The project ID.
  • scheduleId stringREQUIRED
    The schedule ID. This is appended to the end of the url in the response for schedule operations.

Request body:

  • Content-Type: application/json

    Specifies updates to passes or adaptive links at a particular date and time.

Responses

  • 200

    Returns the updated schedule object.

    • Content-Type: application/json
      OBJECT PROPERTIES
      • ok boolean

        If true, the operation completed successfully.

      • operation_id string

        Identifies the operation for troubleshooting and logging.

      • schedule_urls array[string]

        URL for the updated schedule.

      • schedules array

Examples

Example request

PUT /v1/schedules/12345/3b13666df-e5b3-4e42-8919-f8d63bd7ce2a HTTP/1.1
Authorization: Basic <Base64 key>
Content-Type: application/json
Api-Revision: 1.2

{
   "name": "New Offer Update",
   "schedule": {
      "scheduled_time": "2017-04-11T18:45:00"
   },
   "update": {
      "audience": {
         "tag": "TZ_ET"
      },
      "pass": {
         "fields": {
            "primary1": {
               "value": "$20 Off"
            },
            "secondary1": {
               "value": "Mega Offer"
            }
         }
      }
   }
}

Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "ok": true,
  "operation_id": "efb18e92-9a60-6689-45c2-82fedab36490",
  "schedule_urls": [
     "https://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109"
  ],
  "schedules": [
     {
        "url": "https://wallet-api.urbanairship/v1/schedules/12345/2d69320c-3c91-5241-fac4-248269eed109",
        "name": "New Offer Update",
        "schedule": {
           "scheduled_time": "2017-04-11T18:45:00"
        },
        "update": {
           "audience": {
              "tag": "TZ_ET"
           },
           "pass": {
              "fields": {
                 "secondary1": {
                    "value": "Mega Offer"
                 },
                 "primary1": {
                    "value": "$20 Off"
                 }
              }
           }
        }
     }
  ]
}