MAZ Push Notifications API MAZ Push Notifications API

MAZ Push Notifications API

Vijay Sharma Vijay Sharma

Create new push notifications for your content using the MAZ Push Notifications API and they will appear within the MAZ Dashboard. Use the following parameters in order to send a POST request to the MAZ Push Notification API.

API Endpoint

https://dashboard.mazsystems.com/services/schedule_push_notification

API Request Headers

Content-type: Application/JSON
Accept: Application/JSON

Status Codes

200: Successful request

403: Incorrect Data

500: Internal Server Error

Parameter Description

Parameter Description
tracking_name

The name of your push notification. This is used internally, and will not be displayed to end users. A required parameter.

notification_text

The message you would like to send to your users. Ideally, this should not be blank.

notification_url

Send your consumer to a desired URL when the notification is clicked. This may also be a valid deeplink URL to content within your app.

segment

Choose which cohort of users should receive this notification. The cohorts are divided by types of possible subscribers, so this is ideal if your app offers subscriptions. Otherwise, default parameter "all" should be used. The 4 possible values:

  1. "all" : All of your users (this is the default value).

  2. "sub" : Only subscribed users. 

  3. "expired" : Users with expired subscriptions.

  4. "no_sub" : Users without a subscription.

ios

A value of "true"  will send this notification to iOS devices. A value of "false"  will exclude iOS devices.

android

A value of "true"  will send this notification to Android devices. A value of "false"  will exclude Android devices.

scheOpt Schedule your notification to be sent immediately(now) or in the future. The two possible options are:
"now"
: Send your notification immediately (this is the default parameter).
"future"
: If a notification is scheduled for a future delivery, "time" parameter will need to be included within the API request. date, time, and time_zone will need to be included exactly in the format shown below. An example would look like:
"scheOpt": "future",
"time": {"date": "April 2, 2020", "time": "7:00PM", "time_zone": "+0530"},
slug Your app's unique name in our database.
api_token Token used for accessing the API
app_token

Unique token for your app.

geo_fencing_all_countries

"true" / "false". Required in case your app has Geo-fencing enabled. If true, the notification will be sent to all countries. If set to false, a list of country is to be provided.

lcountries

A list of all country codes, where the notification will be sent.


Sample API Request

With Schedule option: Now | Geo-Fencing Off

{
   "push": {
        "tracking_name": "My API Notification",
        "notification_text": "You really have to check this out!",
        "notification_url": "www.example.com",
        "segment": "all",
        "ios": "true",
        "android": "true"
    },
    "scheOpt": "now",
    "slug": "<your_app_slug>",
    "api_token": "<api_token>",
    "app_token": "<your_app_token>"
}

With Schedule option: Future | Geo-Fencing Off

{
   "push": {
        "tracking_name": "My API Notification",
        "notification_text": "You really have to check this out!",
        "notification_url": "www.example.com",
        "segment": "all",
        "ios": "true",
        "android": "true"
    },
    "scheOpt": "future",
    "time": {"date": "April 22, 2020", "time": "7:00PM", "time_zone": "+0530"},
    "slug": "<your_app_slug>",
    "api_token": "<api_token>",
    "app_token": "<your_app_token>"
}

With Schedule option: | Geo-Fencing On

{
"push":{
"tracking_name":"My API Notification",
"notification_text":"You really have to check this out!",
"notification_url":"www.example.com",
"geo_fencing_all_countries":"true",
"lcountries":[
"DZ",
"AO",
"BJ",
"BW",
],
"segment":"all",
"ios":"true",
"android":"true"
},
"scheOpt":"future",
"time":{
"date":"April 2, 2020",
"time":"7:00PM",
"time_zone":"+0530"
},
"slug":"<slug>",
"api_token":"<api_token>",
"app_token":"<app_token>"
}


Please reach out to success@mazsystems.com to get the API Token, App Token and Slug for your App or if you need more information on this API.