Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

The Direct Trigger Push Message API based on template is used to send the following types of messages:

...

POSThttps://saas.appoxee.com/api/v3/message/direct

 

Request Header

The request header must include the following authentication parameters, used to log into Appoxee:

NameValue
X-ACCOUNT_CODE

Your Appoxee account code.

In case you don't have an account code add your Appoxee user name here as well

X-USERNAME

Your Appoxee user name.

X-PASSWORD

Your Appoxee password.

Example Request

 

Trigger a "Direct" Message

 

Request paramters

 

Parameter name
Mandatory
Parameter type
Parameter value
Acceptable values
Example
template_idyesINTMessage template id-123
messages_datayesARRAYMessages data-

[{
"alias": "mor",
"push_body": "hello"
}]

 

Each API request body should contain the following  parameters:

 

Parameter name
Mandatory
Parameter type
Parameter value
Acceptable values
Example
aliasyesSTRINGDevice alias-"mor"
push_bodyyesSTRINGPush body text-"hello world!"
push_badgenoINTPush badge value-5
soundnoSTRINGName of sound file-"greeting"
payloadnoOBJECTExtra fields- 
ios_push_titleno
Status
colourBlue
titleString
G
Push title-"title"
ios_subtitleno
Status
colourBlue
titleString
Push sub title-"sub title"
ios_apx_mediano
Status
colourBlue
titleString
Push media content url-"http://pngimg.com/uploads/google/google_PNG19629.png"
ios_mutable_contentno
Status
colourYellow
titleint
Whether content is rich or not-1

 

Example request

 

The following request will trigger template 1234 to alias "mor"

 

Request Format

 

{
     "template_id" 2350498 ,
         "messages_data" : [
             {
                 "alias" "mor" ,
                 "push_body" "hello" ,
                 "push_badge" 5 ,
                 "sound" "greeting" ,
                 "payload" : {
                     "apx_dpl" "myapp://product/4" ,
                     "banner" "1234"
                 }
             }
         ]
}

 

Example 2

{
    "template_id": 133992002,
        "messages_data": [
            {
                "alias": "goldtl72",
                "push_body": "Hello John please check your account credit",
                "push_badge": 1,
                "sound": "greeting",
                "payload": {
                    "apx_dpl": "myapp://product/4",
                    "banner": "1234"
                }
            },
            {
                "alias": "shaun234",
                "push_body": "Hello Shaun please check your account credit",
                "push_badge": 2,
                "sound": "welcome",
                "payload": {
                    "apx_dpl": "myapp://product/454",
                    "banner": "1234"
                }
            }
   ]
}

 



ResponseResponse Format

HTTP Response Header

HTTP Header FieldValue
Status Code
  • Upon success – 200 OK 
  • Upon failure – the failure status code (for example: "400 Bad Request")

 

HTTP Response Body

The response body includes a description of the request result in JSON format. 
The API call has one of the following results:

 

{
    "metadata": {
        "error"false
    },
    "links": [],
    "payload": {
        
Response ResultReturnsExamples
metadata

Contains the "error" parameter:

  • If the Push message was sent successfully, the error value is "false"
  • Otherwise, the error value is "true"

{

    "error": "false"

}

 

 

Request Example 1:

 

{

     "template_id":

 "2350498"

133992002,

        

     "messages_data": [

            

      {

                

          "alias":

 

"

mor

goldtl72",

                

          "push_body":

 "hello

"Hello John please check your account credit",

                

          "push_badge":

 5

1,

                

          "sound":

 

"greeting"

            }
        ]

,
     

    

}
}

 

Example 3

 

{
"template_id

"payload":

194736,
"ios_push_title":"title",
"ios_subtitle":"sub title",
"ios_apx_media":"http://pngimg.com/uploads/google/google_PNG19629.png",
"ios_mutuable_content":1,
"messages_data": [
{

{
               "apx_dpl": "myapp://product/4",
               "banner": "1234"
          }
     },
     {
     "alias": "

mor

shaun234",
     "push_body": "

hello

Hello Shaun please check your account credit",
     "push_badge":

5

2,
     "sound": "

greeting

welcome",
          "payload": {
               "apx_dpl": "myapp://product/

4

454",
               "banner": "1234"
          }
      }
     ]
}

 

Response

HTTP Response Header

 

HTTP Field HeaderValue
Status Code
  • Upon success – 200 OK
  • Upon failure – the failure status code (for example: "400 Bad Request")

 

 

Response Body:

 

{
"metadata": {
"error": false
},
"links": [],
"payload": {
"template_id": 194736,
"platform": "0",

Request Example 2:

{
      "template_id":194736,
      "messages_data": [
      {
          "alias": "mor",
          "push_body": "hello",
           "push_badge": 5,
          "ios_push_title":"title",
           "ios_subtitle":"sub title",
           "ios_apx_media":"http://pngimg.com/uploads/google/google_PNG19629.png",
          "ios_

mutuable

mutable_content":1,

"messages_data": [
{
"alias": "mor",
"push_body": "hello",
"push_badge": 5,
"

          "sound": "greeting",
          "payload": {
          "apx_dpl": "myapp://product/4",
          "banner": "1234"
          }
      }

     ]
}

}