Pushnews API API Reference

Pushnews API documentation

API Endpoint
https://api.pushnews.eu/v2
Contact: [email protected]
Schemes: https
Version: 2.1.0

Authentication

ApiKeyAuth

type
apiKey
in
header
name
X-Auth-Token

push

Send, Schedule and Cancel Push Notifications

Send a Push Notification

POST /push/{siteId}

Notification object

siteId: string
in path

Site ID

Request Content-Types: application/json
Request Example
{
  "subscriberIds": [
    "0d224a02-690f-4ef1-bb47-07da9bac326c_49c1ea36-dadc-4d4b-8955-529776f68bae"
  ],
  "segmentation": {
    "device": "mobile|desktop",
    "countryCode": "BR",
    "stateCode": "SP",
    "cityName": "São Paulo",
    "segmentKey": "pn-category",
    "segmentValue": "Sci-Tech"
  },
  "sendAt": "2012-12-12 12:12:12",
  "replacePreviousPush": true,
  "message": {
    "title": "Hello!",
    "body": "Welcome to Pushnews :)",
    "url": "https://www.google.com/?utm_source=pushnews",
    "icon": "https://ilabs-static.s3.amazonaws.com/push/icon128_pushnews.jpg",
    "bigImage": "https://pushnews.s3.amazonaws.com/app-assets/pushnews-chrome-big-image.png"
  }
}

Push Notification was sent successfully

400 Bad Request

Missing required data

403 Forbidden

Forbidden Operation

404 Not Found

Site not found

Response Content-Types: application/json
Response Example (200 OK)
{
  "success": true,
  "message": "Notification was sent",
  "data": {
    "notificationId": "11111111-2222-3333-4444-555555555555"
  }
}

mail

Send, Schedule and Cancel Push Mails

Send a Push Mail

POST /mail/{siteId}

Mail object

siteId: string
in path

Site ID

Request Content-Types: application/json
Request Example
{
  "title": "Hello!",
  "body": "Welcome to Pushnews :)",
  "url": "https://www.google.com/?utm_source=pushnews",
  "image": "https://ilabs-static.s3.amazonaws.com/push/icon128_pushnews.jpg"
}

Push Mail was sent successfully

400 Bad Request

Missing required data

403 Forbidden

Forbidden Operation

404 Not Found

Site not found

Response Content-Types: application/json
Response Example (200 OK)
{
  "success": true,
  "message": "Mail was sent",
  "data": {
    "mailId": "11111111-2222-3333-4444-555555555555"
  }
}

notification stats

It returns a stats of notifications of a given site.

GET /site/{siteId}/notifications_stats
siteId: string
in path

Site ID

date_start: string
in query

Start Date: YYYY-MM-DD

date_end: string
in query

End Date: YYYY-MM-DD

kind: string ad, recurring, recurring_facebook, recurring_feed, scheduled, api
in query

Kind of push

force_update_stats: boolean
in query

True if you want to force stats to reload.

page: integer
in query

Page

per_page: integer
in query

Per Page

Stats successfully requested

400 Bad Request

Missing required data

403 Forbidden

Forbidden Operation

404 Not Found

Site not found

Response Content-Types: application/json
Response Example (200 OK)
{
  "success": true,
  "message": "Site Notification Stats",
  "data": "object",
  "page": 1,
  "per_page": 10
}

Schema Definitions

Notification: object

subscriberIds: SubscriberId
SubscriberId
segmentation: object
device: string
countryCode: string
stateCode: string
cityName: string
segmentKey: string
segmentValue: string
sendAt: string
replacePreviousPush: boolean
message: Message
Example
{
  "subscriberIds": [
    "0d224a02-690f-4ef1-bb47-07da9bac326c_49c1ea36-dadc-4d4b-8955-529776f68bae"
  ],
  "segmentation": {
    "device": "mobile|desktop",
    "countryCode": "BR",
    "stateCode": "SP",
    "cityName": "São Paulo",
    "segmentKey": "pn-category",
    "segmentValue": "Sci-Tech"
  },
  "sendAt": "2012-12-12 12:12:12",
  "replacePreviousPush": true,
  "message": {
    "title": "Hello!",
    "body": "Welcome to Pushnews :)",
    "url": "https://www.google.com/?utm_source=pushnews",
    "icon": "https://ilabs-static.s3.amazonaws.com/push/icon128_pushnews.jpg",
    "bigImage": "https://pushnews.s3.amazonaws.com/app-assets/pushnews-chrome-big-image.png"
  }
}

SubscriberId: string

Message: object

title: string
body: string
url: string
icon: string
bigImage: string
Example
{
  "title": "Hello!",
  "body": "Welcome to Pushnews :)",
  "url": "https://www.google.com/?utm_source=pushnews",
  "icon": "https://ilabs-static.s3.amazonaws.com/push/icon128_pushnews.jpg",
  "bigImage": "https://pushnews.s3.amazonaws.com/app-assets/pushnews-chrome-big-image.png"
}

NotificationApiResponse: object

success: boolean
message: string
data: object
Example
{
  "success": true,
  "message": "Notification was sent",
  "data": {
    "notificationId": "11111111-2222-3333-4444-555555555555"
  }
}

Mail: object

title: string
body: string
url: string
image: string
Example
{
  "title": "Hello!",
  "body": "Welcome to Pushnews :)",
  "url": "https://www.google.com/?utm_source=pushnews",
  "image": "https://ilabs-static.s3.amazonaws.com/push/icon128_pushnews.jpg"
}

MailApiResponse: object

success: boolean
message: string
data: object
Example
{
  "success": true,
  "message": "Mail was sent",
  "data": {
    "mailId": "11111111-2222-3333-4444-555555555555"
  }
}

NotificationsStatsResponse: object

success: boolean
message: string
data: object
page: integer
per_page: integer
Example
{
  "success": true,
  "message": "Site Notification Stats",
  "data": "object",
  "page": 1,
  "per_page": 10
}