Messaging

This section contains resources related to the Messaging. The endpoints in this section enables you to interact with the messaging data collected by the app. Through the API you can create as well as retrieve messaging data.
For more information please refer to Getting Started With Messaging

Endpoints

Here is the list of endpoints for Messaging.

  
    
            POST $BASE_URL/v1/messaging/{bucketId}
            GET $BASE_URL/v1/messaging_history/{bucketId}
          
  

1. Send a new message

Sends a new Message according to rules set in Konso App. A new message can be sent using the endpoint:

  
    POST $BASE_URL/v1/messaging/{bucketId}
  
The request object

The request object contains an instance of an object that is to be sent to create a new Message entry. The object is transferred as part of the request's body.

Attributes

The attributes refers to elements that makes up the request object:

recipients required
array
List of recipients to send a message.
messageType required
number
Type of processor email - 1, sms - 2 or push - 3.
subject optional
string
Subject for the message. Applicable for emails
plainBase64Body optional
string
Plain text message body 64 encoded.
htmlBase64Body optional
string
Html message body 64 encoded.
env optional
string
Environment parameter.
delay optional
number
Delay message sending in seconds.
tags optional
string
Useful for message routing.
appName optional
string
Useful for message routing.
correlationId optional
string
Associate message with other functionality.
tags optional
strings array
Adding a tag(s) for the entry.
Sample Request Example
  
    POST $BASE_URL/v1/messaging/{bucketId}
  
  
    
            {
              "plainBase64Body":null,
              "htmlBase64Body":"PGgxPkhlbGxvPC9oMT4=",
              "env":"DEV",
              "recipients":["test@konso.io"],
              "subject":"test subject",
              "delay":0,
              "messageType":1,
              "tags":null,
              "appName":"MyTestApp",
              "correlationId":null,
              "tags": ["test", "mvp"]
            }
          
  

2. Get entries

Returns messaging history entries matching the query filter. Messaging history entries can be queried using the endpoint:

  
    GET $BASE_URL/v1/messaging_history/{bucketId}
  
Filter parameters

Lists and filters messaging history entries. Entries are kept in our storage according to retention days setting.

Attributes

The attributes refers to elements that makes up the filter parameters:

fromDate optional
number
A greater than or equals filter on the list timeStamp field, the value is Unix epoch.
toDate optional
number
A less than or equals filter on the list timeStamp field, the value is Unix epoch.
email optional
string
Filter results by recipient.
correlationId optional
string
Only return entries for the correlationId specified.
subject optional
string
Filter results by term in subject property.
from optional
number
A cursor user in pagination. Default 0
to optional
number
A cursor user in pagination. Default 10
tags optional
string
Filter results by tag. Multiple values are supported.
sort optional
number
1 - timestamp asc, 2 - timestamp desc (default), 3 - response code asc, 4 - response code desc.
Sample Request Example
  
    
            GET $BASE_URL/v1/messaging_history/{bucketId}
            ?fromDate=1619636000
            &toDate=1619637000
            &name=GET
            &correlationId=
            &appName=testApp
            &tags=tag1
            &tags=tag2
            &sort=2
            &from=0
            &to=100