Instant sending

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


Send Push Instantly

POST https://core.push.express/api/b/v2/send/instant

  • Description: This endpoint allows user to send push right now to devices chosen by filters. It creates new one-time sending with due moment 2 minutes after request, creates and attaches new push with translations to this newly created one-time sending in future.

Request

curl --url "https://core.push.express/api/b/v2/send/instant"
    --request POST
    --header "content-type: application/json"
    --header "Authorization: Bearer ..."
    --data '
{
  "name": "Name of scheduler",
  "filters": {
    "all_apps": false,
    "app_ids_include": [
      123,
      234
    ],
    "app_ids_exclude": [
      345
    ],
    "app_groups_include": [
      1
    ],
    "app_groups_exclude": null,
    "all_countries": false,
    "countries_include": [
      "PT",
      "GB"
    ],
    "countries_exclude": [],
    "all_languages": true,
    "languages_include": [],
    "languages_exclude": [
      "pt"
    ],
    "all_audiences": false,
    "audiences_include": [
      "myaud1_1234",
      "myaud2_1234"
    ],
    "audiences_exclude": [
      "myaud3_1234"
    ],
    "audience_groups_include": [
      11,
      22
    ],
    "audience_groups_exclude": [
      33
    ],
    "event_include": "install",
    "event_exclude": "reg"
  },
  "push": {
    "default_lang": "en",
    "translations": [
      {
        "language": "en",
        "title": "Title Of My Push",
        "text": "Text of my push",
        "image": "link-to/image/for.my.push",
        "icon": "link-to/icon/for.my.push",
        "link": "link-for.my.push"
      },
      {
        "language": "pt",
        "title": "Título do meu push",
        "text": "Texto do meu push"
      },
      ...
    ]
  }
}

Body params:

  • name, required, string. Name of scheduler.

  • filters, required, object. Filters to choose devices. More on filters see in one-time sending in future API reference.

  • push, required, object. Push with translations to send. More on push parameters see in pushes API reference.

Response:

  • 201: New one-time sending in future created

{
  "sched_id": 12345,
  "push_id": 9876,
  "translations": [
    {
      "id": 111,
      "language": "en"
    },
    {
      "id": 222,
      "language": "pt"
    },
    ...
  ]
}
  • sched_id, int. ID of newly created one-time sending.

  • push_id, int. ID of newly created push.

  • translations, object. Info about newly created translations for push.

If 201 got there is no way to cancel sending via API. Use web personal account to do it if needed.


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 provided sched_id doesn't exist

  • All 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