Open API v1.0 (1.0)

Download OpenAPI specification:Download

The definition of Errors:

NOT_AUTHORIZED - You don't have the permission to access APIs. Maybe you're using wrong Client Key.

PERMISSION_DENIED - You don't have the permission to execute the task.

INVALID_PARAM - Your HTTP parameter is invalid or missing.

INVALID_REQUEST - Your HTTP request is invalid.

LIMIT_EXCEEDED - Your account or application limit reached.

DUPLICATION - The item is existed.

NOT_FOUND - We can not find your item.

UNKNOWN_ERROR - Internal server error (An unknown error has occurred). Please contact with us in this case.

Authentication

ClientKey

When you create an app, Pushdy will generate Client Key automatically. You need to copy your Client Key and pass to HTTP Header of APIs.

Security scheme type: API Key
Header parameter name: client-key

Application

View application

View the details of a single app

Authorizations:

Responses

200

Return application object

get /application

Live Server

https://api.pushdi.com/application

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "GET" "https://api.pushdi.com/application"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "data":
    {
    }
}

Configuration

Configure platform

Configure platform for a single app.

Support iOS and ANDROID via Rest API only. For other platforms, you have to use our Dashboard to setting.

Authorizations:
path Parameters
platform
string
Enum: "ios" "android"

The platform identifier.

Request Body schema: application/json
fcm_key
string

ANDROID - Firebase cloud message token

apns_pem
string

iOS - Base64-encoded content of APNS Certificate in PEM file format

apns_env
string

iOS - Enviroment of APNS (development or production)

Responses

200

Return success status

post /platform/{platform}

Live Server

https://api.pushdi.com/platform/{platform}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "fcm_key": "string",
  • "apns_pem": "string",
  • "apns_env": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

Attributes

Manage attributes of single app.

Get all attributes

View the details of all attributes of a single app

Authorizations:

Responses

200

Attribute list was retrieved successfully

get /attribute

Live Server

https://api.pushdi.com/attribute

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "GET" "https://api.pushdi.com/attribute"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "data":
    [
    ]
}

Add an attribute

Add a new attribute to one of your apps.

Authorizations:
Request Body schema: application/json
name
required
string <= 50 characters ^[a-z0-9_]+$

Name of attribute

type
required
string
Enum: "boolean" "string" "array" "number"

Attribute type

label
string <= 100 characters

Label for this attribute

Responses

200

Return success status

post /attribute

Live Server

https://api.pushdi.com/attribute

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "type": "boolean",
  • "label": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

Edit an attribute

Edit an attribute of one of your apps.

Authorizations:
Request Body schema: application/json
name
required
string <= 50 characters ^[a-z0-9_]+$

Name of attribute

new_name
string <= 50 characters ^[a-z0-9_]+$

New name for replacement

label
string <= 100 characters

New Label for replacement

Responses

200

Return success status

put /attribute

Live Server

https://api.pushdi.com/attribute

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "new_name": "string",
  • "label": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

Delete an attribute

Delete an attribute of app.

Authorizations:
Request Body schema: application/json
name
required
string <= 100 characters ^[a-z0-9_]+$

Name of attribute

Responses

200

Return success status

delete /attribute

Live Server

https://api.pushdi.com/attribute

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

Events

Manage events of single app.

Add a event data

Add a realtime event data to use in trigger push notification.

Authorizations:
Request Body schema: application/json
custom_id
required
string

The unique key for your event data.

your_event_field_1
boolean

Example: true

your_event_field_2
integer

Example: 123

your_event_field_3
string

Example: 'your string'

your_event_field_4
array

Example: ['your value 1', 'your value 2']

your_event_field_5.date
integer

Example: 1569899799 - Unix Timestamp

Responses

200

Return response status

post /event

Live Server

https://api.pushdi.com/event

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "custom_id": "string",
  • "your_event_field_1": true,
  • "your_event_field_2": 0,
  • "your_event_field_3": "string",
  • "your_event_field_4": [ ],
  • "your_event_field_5.date": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true
}

Player

Manage players of single app.

Add a player

Register a new player to one of your apps.

If a player is already registered with the specified identifier, then this will update the existing player record instead of creating a new one.

Authorizations:
Request Body schema: application/json
device_type
required
string
Enum: "ios" "android" "other"

The device's platform.

device_id
required
string

The device identifie.

device_token
string

The device push token.

ANDROID, iOS, CHROME, SAFARI, FIREFOX, COCOC

mobile_number
string^[+]*[0-9]{1,4}[/0-9]{10,15}$

The mobile number. Formatting for phone numbers entails the following:

1. A + (plus) sign

2. International Country Calling code

3. Phone number

Example: +84912345678

device_os
string

Device operating system version.

Example: 12.1.4

device_model
string

Device operating system version.

Example: iPhone5,1

app_version
string

Your application's version.

Example: 1.2.1

language
string

Language code in the ISO Language Code (first 2 characters).

Example: vi

country
string

Country code in the ISO 3166-1 Alpha 2 format.

Example: vn

custom_user_id
string

A custom user ID.

Example: 98765

any_parameter_name
string <lowercase> [ 2 .. 100 ] characters
Default: "Your custom parameter"

Custom parameter for the player.

1. You can choose any name from your 'Attributes' for 'any_parameter_name'
   in lowercase.

2. Upto 50 custom parameter fields.

3. Allowed custom parameter type are 'boolean', 'string', 'number', 'array'.

Example:

categories: ['real estate', 'home']

price: 1.5

product: 'book'

Responses

200

Return player ID

post /player

Live Server

https://api.pushdi.com/player

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "device_type": "ios",
  • "device_id": "string",
  • "device_token": "string",
  • "mobile_number": "string",
  • "device_os": "string",
  • "device_model": "string",
  • "app_version": "string",
  • "language": "string",
  • "country": "string",
  • "custom_user_id": "string",
  • "any_parameter_name": "Your custom parameter"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "id": "string"
}

Edit a player

Update an existing player in one of your apps.

Authorizations:
path Parameters
player_id
required
string

The player ID

Request Body schema: application/json
device_token
string

The device push token.

ANDROID, iOS, CHROME, SAFARI, FIREFOX, COCOC

app_version
string

Your application's version.

Example: 1.2.1

my_gender
string

Your custom parameter

my_age
integer

Your custom parameter

Responses

200

Return success status

put /player/{player_id}

Live Server

https://api.pushdi.com/player/{player_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "device_token": "string",
  • "app_version": "string",
  • "my_gender": "string",
  • "my_age": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

New session

Update a player's session information.

This method should be called when a player opens your app after they are already registered.

This method will automatically increment the player's SESSION_COUNT.

By default, if a player is inactive for 30 minutes or more, any future activity is attributed to a new session. Users that leave your site and return within 30 minutes are counted as part of the original session.

Authorizations:
path Parameters
player_id
required
string

The player ID

Responses

200

Return success status

post /player/{player_id}/on_session

Live Server

https://api.pushdi.com/player/{player_id}/on_session

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "POST" "https://api.pushdi.com/player/YOUR_PLAYER_ID/on_session"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

Notification

Manage notification, sengmentation and messages of single app.

View notifications

View the details of multiple notifications.

Authorizations:
query Parameters
title
string

The message title of notification

tag
string

The tag of notification

limit
integer
Default: 10

The number of items per page

page
integer
Default: 1

The pagination page number

start_on
integer

The start date in Unix Time Stamp

end_on
integer

The end date in Unix Time Stamp

Responses

200

Return notification list

get /notification

Live Server

https://api.pushdi.com/notification

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "GET" "https://api.pushdi.com/notification"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "page": 0,
  • "limit": 0,
  • "total": 0,
  • "data":
    [
    ]
}

Create notification

Send notification to segmentations or individual players.

Authorizations:
Request Body schema: application/json
options
object

Push Scope object

type
required
string
Default: "mobile_push"
Enum: "mobile_push" "web_push" "sms" "facebook"

The notification type

headings
string

Mobile Push - The title of message.

contents
required
string

The content of message

status
string
Default: "waiting"
Enum: "new" "waiting"

Status of notification.

A new notification will wait for updating to waiting before start.

platforms
Array of strings (NativePlatform)
Items Enum: "ios" "android"

Mobile Push - The enabled platforms of notification

player_ids
array

The filters by player ids. It is useful for sending realtime messages by your logic.

Example:

[
  "f6fdaf46-3a7d-36ec-8cc8-f2f64e7ddd7f"
  "a0b962c3-3899-4b97-9ba8-47c2357e4988"
]
filters
array

The target filters.

Formatting Filters:

[
  {"field":"attr1","relation":"=","value":"value11"},
  [
    {"field":"attr2","relation":"=","value":"value21"},
    {"operator":"OR"},
    {"field":"attr2","relation":"=","value":"value22"}
  ],
  {"operator":"OR"},
  {"field":"attr3","relation":"=","value":"value3"},
  {"operator":"OR"},
  {"field":"attr1","relation":"=","value":"value12"},
  {"field":"attr4","relation":"=","value":"value4"}
]
data
array

A custom map of data that is passed back to your app.

Example:

Mobile Push

{"key1": "value1", "foo": "bar"} 

Web Push

{
  "url": "Target link to open when user tap on push.",
  "icon": "Icon link to display beside push content",
  "image": "Big image link to display on top of push content",
  "actions": [
    {
      "action": "button_id1",
      "title": "Button text. Example: 'View now'",
      "icon": "Small icon link to display for button 1 (optional)",
      "url": "Target link to open when user click to this button"
    },
    {
      "action": "button_id2",
      "title": "Button text. Example: 'Add to my shopping cart'",
      "icon": "Small icon link to display for button 2 (optional)",
      "url": "Target link to open when user click to this button"
    }
  ],
  "utm": {
    "source": "Campaign Source",
    "term": "Campaign Term",
    "campaign": "Campaign Name",
    "medium": "Campaign Medium",
    "content": "Campaign Content"
  } 
}
tags
array

Dynamic tags used for group notification.

Example:

["daily push", "for vip customer"]
schedule
integer
Default: 0

The schedule in Unix Time Stamp for future delivery. Default: Sending immediately.

Responses

200

Return notification ID

post /notification

Live Server

https://api.pushdi.com/notification

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "options":
    {
    },
  • "type": "mobile_push",
  • "headings": "string",
  • "contents": "string",
  • "status": "waiting",
  • "platforms":
    [
    ],
  • "player_ids": [ ],
  • "filters": [ ],
  • "data": [ ],
  • "tags": [ ],
  • "schedule": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "id": "string"
}

Create multiple notifications

Send multiple notifications to segmentations or individual players.

Authorizations:
Request Body schema: application/json
notifications
Array of objects (NewNotification)

Array of notifications

Responses

200

Return notification ID

post /notifications

Live Server

https://api.pushdi.com/notifications

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "notifications":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Edit notification

Update a notification information, work only for a new notification (notification has new status).

Authorizations:
path Parameters
notification_id
required
string

The ID of notification

Request Body schema: application/json
options
object

Push Scope object

type
required
string
Default: "mobile_push"
Enum: "mobile_push" "web_push" "sms" "facebook"

The notification type

headings
string

Mobile Push - The title of message.

contents
required
string

The content of message

status
string
Default: "waiting"
Enum: "new" "waiting"

Status of notification.

A new notification will wait for updating to waiting before start.

platforms
Array of strings (NativePlatform)
Items Enum: "ios" "android"

Mobile Push - The enabled platforms of notification

player_ids
array

The filters by player ids. It is useful for sending realtime messages by your logic.

Example:

[
  "f6fdaf46-3a7d-36ec-8cc8-f2f64e7ddd7f"
  "a0b962c3-3899-4b97-9ba8-47c2357e4988"
]
filters
array

The target filters.

Formatting Filters:

[
  {"field":"attr1","relation":"=","value":"value11"},
  [
    {"field":"attr2","relation":"=","value":"value21"},
    {"operator":"OR"},
    {"field":"attr2","relation":"=","value":"value22"}
  ],
  {"operator":"OR"},
  {"field":"attr3","relation":"=","value":"value3"},
  {"operator":"OR"},
  {"field":"attr1","relation":"=","value":"value12"},
  {"field":"attr4","relation":"=","value":"value4"}
]
data
array

A custom map of data that is passed back to your app.

Example:

Mobile Push

{"key1": "value1", "foo": "bar"} 

Web Push

{
  "url": "Target link to open when user tap on push.",
  "icon": "Icon link to display beside push content",
  "image": "Big image link to display on top of push content",
  "actions": [
    {
      "action": "button_id1",
      "title": "Button text. Example: 'View now'",
      "icon": "Small icon link to display for button 1 (optional)",
      "url": "Target link to open when user click to this button"
    },
    {
      "action": "button_id2",
      "title": "Button text. Example: 'Add to my shopping cart'",
      "icon": "Small icon link to display for button 2 (optional)",
      "url": "Target link to open when user click to this button"
    }
  ],
  "utm": {
    "source": "Campaign Source",
    "term": "Campaign Term",
    "campaign": "Campaign Name",
    "medium": "Campaign Medium",
    "content": "Campaign Content"
  } 
}
tags
array

Dynamic tags used for group notification.

Example:

["daily push", "for vip customer"]
schedule
integer
Default: 0

The schedule in Unix Time Stamp for future delivery. Default: Sending immediately.

Responses

200

Return notification ID

put /notification/{notification_id}

Live Server

https://api.pushdi.com/notification/{notification_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "options":
    {
    },
  • "type": "mobile_push",
  • "headings": "string",
  • "contents": "string",
  • "status": "waiting",
  • "platforms":
    [
    ],
  • "player_ids": [ ],
  • "filters": [ ],
  • "data": [ ],
  • "tags": [ ],
  • "schedule": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "id": "string"
}

Cancel notification

Cancel a notification of your app.

Authorizations:
path Parameters
notification_id
required
string

The ID of notification

Responses

200

Return success status

delete /notification/{notification_id}

Live Server

https://api.pushdi.com/notification/{notification_id}

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "DELETE" "https://api.pushdi.com/notification/YOUR_NOTIFICATION_ID"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

View notification

View the details of a single notification.

Authorizations:
path Parameters
notification_id
required
string

The ID of notification

Responses

200

Return notification object

get /notification/{notification_id}

Live Server

https://api.pushdi.com/notification/{notification_id}

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "GET" "https://api.pushdi.com/notification/YOUR_NOTIFICATION_ID"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "data":
    {
    }
}

Track open

Track when users open a notification.

Authorizations:
Request Body schema: application/json
opened
boolean

Set to true

player_id
string

Your player id.

platform
string

Your platform

Responses

200

Return success status

put /notification/{notification_id}/track

Live Server

https://api.pushdi.com/notification/{notification_id}/track

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "opened": true,
  • "player_id": "string",
  • "platform": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

Segmentation

Manage sengmentations of single app.

View segmentations

View the details of multiple segments.

Authorizations:
query Parameters
limit
integer
Default: 10

The number of items per page

page
integer
Default: 1

The pagination page number

Responses

200

Return segmentation list

get /segment

Live Server

https://api.pushdi.com/segment

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "GET" "https://api.pushdi.com/segment"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "page": 0,
  • "limit": 0,
  • "total": 0,
  • "data":
    [
    ]
}

Create segmentation

Create segment to used in send notification.

Authorizations:
Request Body schema: application/json
name
required
string <= 100 characters

The segmentation title

description
string <= 500 characters

The segmentation description.

filters
required
array

The target filters.

Formatting Filters:

[
  {"field":"attr1","relation":"=","value":"value11"},
  [
    {"field":"attr2","relation":"=","value":"value21"},
    {"operator":"OR"},
    {"field":"attr2","relation":"=","value":"value22"}
  ],
  {"operator":"OR"},
  {"field":"attr3","relation":"=","value":"value3"},
  {"operator":"OR"},
  {"field":"attr1","relation":"=","value":"value12"},
  {"field":"attr4","relation":"=","value":"value4"}
]

Responses

200

Return segmentation ID

post /segment

Live Server

https://api.pushdi.com/segment

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "description": "string",
  • "filters": [ ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "id": "string"
}

Update segmentation

Update a segmentation of your app.

Authorizations:
path Parameters
segment_id
required
string

The segmentation ID

Request Body schema: application/json
name
required
string <= 100 characters

The segmentation title

description
string <= 500 characters

The segmentation description.

filters
required
array

The target filters.

Formatting Filters:

[
  {"field":"attr1","relation":"=","value":"value11"},
  [
    {"field":"attr2","relation":"=","value":"value21"},
    {"operator":"OR"},
    {"field":"attr2","relation":"=","value":"value22"}
  ],
  {"operator":"OR"},
  {"field":"attr3","relation":"=","value":"value3"},
  {"operator":"OR"},
  {"field":"attr1","relation":"=","value":"value12"},
  {"field":"attr4","relation":"=","value":"value4"}
]

Responses

200

Return success status

put /segment/{segment_id}

Live Server

https://api.pushdi.com/segment/{segment_id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "description": "string",
  • "filters": [ ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

Delete segmentation

Delete a segmentation of your app.

Authorizations:
path Parameters
segment_id
required
string

The segmentation ID

Responses

200

Return success status

delete /segment/{segment_id}

Live Server

https://api.pushdi.com/segment/{segment_id}

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "DELETE" "https://api.pushdi.com/segment/YOUR_SEGMENT_ID"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "message": "success"
}

View segmentation

View the details of a segmentation.

Authorizations:
path Parameters
segment_id
required
string

The segmentation ID

Responses

200

Return segmentation object

get /segment/{segment_id}

Live Server

https://api.pushdi.com/segment/{segment_id}

Request samples

Copy
curl --header "Content-Type: application/json" \
     --header "client-key: CLIENT-KEY" \
     --request "GET" "https://api.pushdi.com/segment/YOUR_SEGMENT_ID"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "success": true,
  • "data":
    {
    }
}