Schedules
Schedule pass updates for future delivery.
Delete schedule
Deletes the specified schedule.
DELETE /schedules/{projectId}/{scheduleId}
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- projectId stringREQUIREDThe project ID.
- scheduleId stringREQUIREDThe schedule ID. This is appended to the end of the
urlin 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.
GET /schedules/{projectId}/{scheduleId}
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- projectId stringREQUIREDThe project ID.
- scheduleId stringREQUIREDThe schedule ID. This is appended to the end of the
urlin the response for schedule operations.
Responses
200
Returns a single schedule object.
Response body:
- Content-Type:
application/jsonSpecifies 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.
GET /schedules/{projectId}
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- projectId stringREQUIREDThe project ID.
Responses
200
Returns a list of schedules, ordered scheduled_time closest to the present.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json- 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.
POST /schedules/{projectId}
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- projectId stringREQUIREDThe project ID.
Request body:
The schedule update object to schedule an update or the schedule notification object to schedule a notification.
Content-Type:
One ofapplication/jsonSpecifies 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
OBJECT PROPERTIESaudienceorpass, generated from atemplatewithin the project. Cannot be used with the update object present as well.- audience object<Audience selector>
Determines the passes you want to target.
- pass objectOBJECT 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 objectOBJECT 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.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json- 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.
PUT /schedules/{projectId}/{scheduleId}
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- projectId stringREQUIREDThe project ID.
- scheduleId stringREQUIREDThe schedule ID. This is appended to the end of the
urlin the response for schedule operations.
Request body:
Content-Type:
application/jsonSpecifies updates to passes or adaptive links at a particular date and time.
Responses
200
Returns the updated schedule object.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json- 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"
}
}
}
}
}
]
}