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
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
{
  • "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
type
required
string
Default: "mobile_push"
Enum: "mobile_push" "web_push" "sms" "facebook"

The notification type

headings
required
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"