One-time sending in future
Version date: 20 December 2024
To authorize, you need to add the header
"Authorization: Bearer ..."
(get your API KEY in your personal account on "Personal" tab).
Endpoints
Create a OneSend Scheduler
POST https://core.push.express/api/b/v2/sched/onesend
Description: Creates a new one-time sending in future. Scheduler allows tuning the group of receivers via filters and choosing a moment for sending in future. No sending happens if scheduler has no attached pushes.
Request
Body params:
part 1, name
name
, required, string. Name of scheduler.
part 2, moment of sending
date
, required, string. Format YYYY-MM-DDtime
, required, string. Format HH-MMlocal_time
, required, bool. "True" stands for "send by local time of devices", "false" stands for "send by one chosen timezone".timezone
, required if local_time=false, excluded if local_time=true, string. Format +HH:MM. Offset of UTC.
part 3, filters, applications
all_apps
, optional, bool. Flag to include all applications into sending. If chosen True thenapp_ids_include
andapp_groups_include
must be be omitted.app_ids_include
, optional, list of int. List of application IDs to include into sending.app_ids_exclude
, optional, list of int. List of application IDs to exclude from sending.app_groups_include
, optional, list of int. List of application group IDs to include into sending. Make your application groups and manage them hereapp_groups_exclude
, optional, list of int. List of application group IDs to exclude from sending.
If filters result in an empty set of applications then no scheduler is created. Corresponding
_include
and_exclude
lists must have no common elements.
part 4, filters, countries
all_countries
, optional, bool. Flag to include devices with any country into sending. If chosen True thencountries_include
must be be omitted.countries_include
, optional, list of int. List of countries to include into sending. Follow iso3166_1_alpha2 standard.countries_exclude
, optional, list of int. List of countries to exclude from sending. Should be provided only ifall_countries
= true. Follow iso3166_1_alpha2 standard.
part 5, filters, languages
all_languages
, optional, bool. Flag to include devices with any language into sending. If chosen True thenlanguages_include
must be be omitted.languages_include
, optional, list of int. List of languages to include into sending. Follow bcp47_language_tag standard.languages_exclude
, optional, list of int. List of languages to exclude from sending. Should be provided only ifall_languages
= true. Follow bcp47_language_tag standard.
part 6, filters, audiences
In PushExpress audience is a tag that can be attached to devices. Some devices may have no audience.
Create audiences or segments here, create audience or segment groups here
all_audiences
, optional, bool. Flag to include all audiences into sending.
If flag is on then only devices with any audience defined will be reached out while devices with no audience will not be reached out.
If one wants to reach out to all devices regardless of audience they should set all_audiences
to false and omit audiences_include
with audience_groups_include
.
If chosen True then audiences_include
and audience_groups_include
must be be omitted.
audiences_include
, optional, list of string. List of audiences to include into sending.audiences_exclude
, optional, list of int. List of audiences to exclude from sending.audience_groups_include
, optional, list of int. List of audience group IDs to include into sending.audience_groups_exclude
, optional, list of int. List of audience group IDs to exclude from sending.
Corresponding
_include
and_exclude
lists must have no common elements.
part 7, filters, events
Here you can provide only 3 types of events: install, reg, dep. Install includes all the devices, reg includes registered only, dep includes those who toped up balance at least once.
event_include
, optional, string. Filters devices which had this event in history. If field is not provided it will be set toinstall
i.e. devices are to be chosen regardless of event happened.event_exclude
, optional, string. Filters devices which did not have this event in history. If field not provided devices are to be chosen regardless of event that did not happen.
Response:
201: New one-time sending in future created
id
, int. ID of newly created one-time sending.
No sending happens if scheduler has no attached pushes.
Error handling
All HTTP response codes 2xx SHOULD be considered as success. Requested action was executed successfully.
All HTTP response codes above 400 MUST be considered as error. Requested action failed. Retries policy should be hold according to HTTP specification.
Common API errors:
400 - request error. Request has invalid data. Check you request (url, headers, payload)
401 is returned when provided API token is invalid. Check your authentification data.
403 is returned when access to resource for current user is denied.
404 is returned when resource doesn't exist. Check your request data.
Example: PUT
https://core.push.express/api/b/v2/sched/:sched_type/:sched_id/pushes
returns 404 when providedsched_id
doesn't existAll HTTP response codes 5xx - other errors from proxy servers, load balancers, etc. There may or may not have some explanation in response body. These errors always require retries.
API errors have content-type: application/json
header and json response body
Example: {"error": "validation error: ...", "req_id":"<string>"}
Response parameters:
req_id
string is a request ID. It is used by support for problem solving, please, provide it to support if problem emerged.error
object, describing errors.
Non-API errors like 502, 504, etc., may or may not include a description.
Last updated