Our documentation is changing, please click here to enjoy it!

Skip to end of metadata
Go to start of metadata

This API route allows you to send a new message to targets. This new message won't be visible on the Accengage interface but will be linked to an existing one (the "parent" message).

Operations

POST

/sendInstantMessage.php

ParameterModel
body

 

1) Sending on only one application (one partner)

Data (send on 1 application)

2) Sending on multi applications (several partners)

Data (send on multi applications)
Messages

 


 

Message

 


 

Popup

 


 

Target

 


 

Criterion

 


 

Content

 


 

Aps

 


 

InteractiveButtons

The value of the template can be found in the category on the interface or here for the Accengage's templates.


 

Buttons

 


 

CustomParam

 

(1) Only available for Android push messages

(2) Only available for iOS push messages

(3) The name of the image must be provided by the uploadImage API

(4) Only available when targeting one application (not for multi-applications)

(5) Refer to the Apple documentation : https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html

 

Response
body
Return code
returnCodeDescription

0

Instant Message has been sent

1A database error occured
2No sendInstantMessage
3No or bad user
4No or bad partner
5No or bad message
6Bad custom params
9Bad targets
10No parent message ID
11Message limit exceeded
13Field unknown
14Target max number exceeded
15Template cannot be replaced
16No or bad appId
17The selected language does not exist

22

Invalid certificate
23No or bad template for buttons
24Nor or bad button id
25Bad custom params for buttons

If the message has been sent (returnCode: 0) in the case of multiple partners, you will only get the

messageId of the last message that you have provided in the Messages array.

The targets array contains all target definition for the message(s). This array can contain up to 100 entries.

One target object can contain multiple criteria, so a device will be targeted if all the criteria match the device properties. In the example below, a device will only be targeted if its language property is set to "en" AND the user opened the application more than once.

 

If the actions of the buttons are directly set in your request, their value must be one of the following: browser, email, phone, store, sms, webView, urlSheme or close.

 

The message text can contain template macros. These templates will be replaced with, in order:

  • values set in API target data object
  • values set in API message data object
  • values set in the devices database

If no value is found, an error is triggered.

Examples

RequestBodyDescription

POST URL

Exemple with one application
Exemple with multi applications
Exemple with interactive buttons
Sends an instant message
  • No labels