Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

 

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

  • Push notifications - app-related, plain text notifications (as opposed to a Rich messages).  
  • All request data must be sent as an HTTP POST request in the JSON format.

The logic of using this API is as follows:

  • Create an "API Template Message" for all your triggers to be based on, by selecting the option as shown below
  • Copy the "Template ID" of the message, located in the summary page, to be used in the API request defined below
  • Use the API below to trigger messages over the API template message
  • All fields in the trigger API calls you create from your server will override the definitions you entered in the template.
    F or example: if you define sound in the template message  and then wish to send a different sound in the trigger (in the API request), for the specific message sent the sound will be the one you entered in the request. The sound defined in the template message will remain the same.

 

 Appoxee API variables and parameters are case-sensitive.

Push Trigger Message Request (Direct)

Triggers a template based message for a specific alias using an "express". As such this method is optimised for sending single message per single end user

Request URL

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 STRINGGPush title-"title"
ios_subtitlenoSTRINGPush sub title-"sub title"
ios_apx_medianoPUSH MEDIA CONTENT URLPush Rich content source-"http://pngimg.com/uploads/google/google_PNG19629.png"
ios_mutable_contentnoINTWhether 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"
                 }
             }
         ]
}



Response Format

HTTP Response Header

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

 

Examples:

RequestResponse
{
    "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"
                }
            }
   ]
}
{
     "metadata" : {
         "error" false
     },
     "links" : [],
     "payload" : {
         "template_id" "2350498" ,
         "messages_data" : [
             {
                 "alias" "mor" ,
                 "push_body" "hello" ,
                 "push_badge" 5 ,
                 "sound" "greeting"
             }
         ],
 
     }
}

{
"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_mutable_content":1,
"sound": "greeting",
"payload": {
"apx_dpl": "myapp://product/4",
"banner": "1234"
}
}
]
}

{
"metadata": {
"error": false
},
"links": [],
"payload": {
"template_id": 194736,
"platform": "0",
"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_mutable_content": 1,
"sound": "greeting",
"payload": {
"apx_dpl": "myapp://product/4",
"banner": "1234"
}
}
]
}
}

 



 

 

 




 

 

 

 

 

 

  • No labels