Developer API - Push notifications

  1. Push notification attributes
  2. List of all push notifications
  3. Find a specific push notification
  4. Create a new push notification

Push notification attributes

A push notification have the following attributes:

Name Type Description
id Integer Record ID
content String Notification content (payload)
updated_at String Timestamp in ISO 8601 format
created_at String Timestamp in ISO 8601 format
created_by Integer User ID that created the record
created_via String Channel used to create the record (Interface or API)

List of all push notifications

Return an array with all notifications.

Method and URL format

GET https://api.cloudwalk.io/{version}/notifications?access_token={token}

Example of use

$ curl -X GET "https://api.cloudwalk.io/v1/notifications?access_token=$TOKEN"
require 'net/http'

token = 'API_TOKEN'

uri = URI("https://api.cloudwalk.io/v1/notifications?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"

Example of response

{
   "pagination":{
      "page":1,
      "total_pages":1,
      "entries":2,
      "total_entries":2
   },
   "notifications":[
      {
         "notification":{
            "id":1,
            "content":"SHOW_MESSAGE|ping",
            "updated_at":"2015-03-02T18:59:14Z",
            "created_at":"2015-03-02T18:59:14Z",
            "created_by":1,
            "created_via":"interface"
         }
      },
      {
         "notification":{
            "id":2,
            "content":"SHOW_MESSAGE|pong",
            "updated_at":"2015-03-02T18:59:29Z",
            "created_at":"2015-03-02T18:59:29Z",
            "created_by":1,
            "created_via":"interface"
         }
      }
   ]
}

Find a specific push notification

Return the details of a specific notification.

Method and URL format

GET https://api.cloudwalk.io/{version}/notifications/{notification_id}?access_token={token}

Example of use

$ curl -X GET "https://api.cloudwalk.io/v1/notifications/1?access_token=$TOKEN"
require 'net/http'

token = 'API_TOKEN'

uri = URI("https://api.cloudwalk.io/v1/push_notifications/445566?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"

Example of response

{
  "notification":{
    "id":1,
    "content":"SHOW_MESSAGE|ping",
    "updated_at":"2015-03-02T18:59:14Z",
    "created_at":"2015-03-02T18:59:14Z",
    "created_by":1,
    "created_via":"interface"
  }
}

Create a new push notification

Create a new push notification.

Method and URL format

POST https://api.cloudwalk.io/{version}/notifications?access_token={token}

Example of use

$ curl -X POST "https://api.cloudwalk.io/v1/notifications?access_token=$TOKEN" \
-d '{"content":"ping","range":"specific_logical_numbers","group_id":1,"logical_numbers":"00110,00111","kind":"show","app_id":1}'
require 'net/http'
require 'json'

token = 'API_TOKEN'

payload = {
  "content" => "ping",
  "range" => "specific_logical_numbers",
  "group_id" => 1,
  "logical_numbers" => "00110,00111",
  "kind" => "show",
  "app_id" => 1
}

uri = URI("https://api.cloudwalk.io/v1/notifications?access_token=#{token}")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.request_uri)
request.body = payload.to_json

res = http.request(request)

puts "Response #{res.code} #{res.message}: #{res.body}"
  • group_id: The ID of the group that should receive the notification
  • range: group to notify the whole group or specific_logical_numbers to notify only specific logical numbers
  • logical_numbers: If the range "specific_logical_numbers" was select, enter the logical numbers (comma separated)
  • kind: show for instant displaying the content or processing for custom handling of the content
  • app_id: (optional) If the kind "processing" was selected, enter the ID of the application responsible to handle the notification

Example of response

{
  "message":"The notification was successfully received and has been queued for processing."
}