Text / Rich Media

Text messages allows you to send a simple text message with rich media content.

Text message

A Text Message consists of a simple text and has options of including rich media content.

Text message create

POST http://server-v1.2mee.com/notification/create

Create a message lets you create the content required for the payload to be sent. This is the first step towards sending out a push notification. These contents can be updated using the message update API. For a TEXT notification type is always set as TEXT.

Request Body

NameTypeDescription

type

string

Type of message: HOLOPUSH/TEXT (TEXT in this case).

appId

string

Application ID for which this message is being created.

title

string

Appears as the title in the notification. This explains the purpose of the notification.

subtitle

string

Appears as the subtitle in the notification. Additional information that explains the purpose of the notification.

text

string

This appears as the body for the notification.

fbTitle

string

Appears as the title on the notification in case of issues in downloading the media content.

fbSubtitle

string

Appears as a subtitle in the notification in case of issues in downloading the media content.

fbText

string

Appears as the body of the notification in case of issues in downloading the media content.

expiry

number

Duration from playtime after which the push notification expires. A text with content Sorry! Opportunity missed! appears in case the user opens the notification past expiry time.

playTime

number

Time at which the notification should be delivered. Two options are offered - Schedule Now (Notification is sent instantly) and Schedule Later (Notification is delivered at the scheduled time)

about

array

URL of a targeted page can be provided here. This opens as a deep link.

filterId

string

Filter id represents the audience segment and this can be found at audience listing API.

priority

string

Delivery priority for the notification.

favourite

number

A message marked as favourite appears on top of the message listing page in the UI.

channel

string

Channel - PUSH/PULL

action

string

Action text appears on the notification. Upon clicking on the action the text deep link is opened (if provided).

{
    "appId": "bacb37d0-a51f-491b-bd68-489c245b8c16",
    "title": "Title of the Message",
    "subtitle": "SubTitle of the Message",
    "text": "Body of the Message",
    "action": "Open",
    "fbTitle": "FallBack Title of the Message",
    "fbSubtitle": "Fallback SubTitle of the Message",
    "fbText": "FallBack Text of the Message",
    "expiry": 1440,
    "playTime": 1582614107682,
    "about": [],
    "filterId": "9e862fc2-e3b6-4420-bf63-80ad4368ec88",
    "priority": "LOW",
    "favourite": 0,
    "type": "TEXT",
    "channel": "PUSH",
    "segment": null,
    "subType": "T",
    "createdBy": "479cec74-767e-4ecb-9e6d-ee508cadbd75",
    "state": "NEW",
    "companyId": "6c445333-bac9-4ab0-a0b6-cc6838902abb",
    "messageTitle": null,
    "url": null,
    "id": "f4769c89-939b-4521-9435-5b3ce49d8fdb",
    "size": null,
    "tags": null,
    "parentMessageId": null,
    "holoPushAd": null,
    "jobId": null,
    "holoPushUrl": null
}

Shown below are the steps that you would go through if a Rich Media message was created using UI:

Example Curl command for creating a message:

$ curl 'https://exchange-prod-g.2mee.com/notification/create' -i -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU4OTQ1NTc0OSwiaWF0IjoxNTg5NDM3NzQ5fQ.U2VtugGzqD0s9p0rUXaTxk8F5tHeMf5SB4ZRnYM8TV4QQm6y2FvdFIfD6kjQOhcYuPglSusAjVegzHqDKGgCqA' -d '{
  "appId" : "bacb37d0-a51f-491b-bd68-489c245b8c16",
  "title" : "Title of the Message",
  "subtitle" : "SubTitle of the Message",
  "text" : "Body of the Message",
  "action" : "Open",
  "fbTitle" : "FallBack Title of the Message",
  "fbSubtitle" : "Fallback SubTitle of the Message",
  "fbText" : "FallBack Text of the Message",
  "expiry" : 1440,
  "playTime" : 1582614107682,
  "about" : [],
  "filterId" : "9e862fc2-e3b6-4420-bf63-80ad4368ec88",
  "priority" : "LOW",
  "favourite" : 0,
  "type" : "TEXT",
  "channel" : "PUSH"
}'

Text message update

PUT https://exchange-prod-g.2mee.com/notification/update

Before the Notification is scheduled it can be updated using this API.

Request Body

NameTypeDescription

filterId

string

Audience segment picked up for the delivery of the notification. Can be found at audience listing API.

action

string

Action text is provided in notification. Upon clicking action text deep link is opened (if provided).

text

string

This appears as the body of the notification. Content of text notification.

id

string

Message Id whose information is to be updated

title

string

Appears as the title on the notification and on the notification alert. This explains the purpose of notification.

subtitle

string

Appears as the subtitle of the notification and on the notification alert. This explains additional information about the notification.

fbTitle

string

Fallback title for the notification in case the file is not downloaded.

fbSubtitle

string

Fallback subtitle in case there are issues downloading the file.

fbText

string

Fallback body of notification in case of not downloading the file.

expiry

number

Duration from the playtime after which the notification expires.A text with content Sorry! Opportunity missed! will appear if the user opens the notification past expiry time.

playTime

number

Time at which notification has to be delivered. Two options are offered. 1.Schedule Now(Notification will be sent instantly). 2.Schedule Later(Notification will be delivered at the provided time).

about

array

URL of the targeted page can be provided here. Will act as a deep link.

priority

string

The priority of the message. HIGH/MEDIUM/LOW in string format.

favourite

number

A message marked as a favourite will appear on the top of the message listing page in the UI.

{
    "appId": "bacb37d0-a51f-491b-bd68-489c245b8c16",
    "title": "Title of the Message",
    "subtitle": "SubTitle of the Message",
    "text": "Body of the Message",
    "action": "Open",
    "fbTitle": "updated FallBack Title of the Message",
    "fbSubtitle": "Fallback SubTitle of the Message",
    "fbText": "FallBack Text of the Message",
    "expiry": 1440,
    "playTime": 1582614107682,
    "about": [{
        "key": "__openExternalURL",
        "value": "https://2mee.com/"
    }],
    "filterId": "9e862fc2-e3b6-4420-bf63-80ad4368ec88",
    "priority": "LOW",
    "favourite": 0,
    "type": "TEXT",
    "channel": "PUSH",
    "segment": null,
    "subType": "T",
    "createdBy": "479cec74-767e-4ecb-9e6d-ee508cadbd75",
    "state": "NEW",
    "companyId": "6c445333-bac9-4ab0-a0b6-cc6838902abb",
    "messageTitle": null,
    "url": null,
    "id": "f4769c89-939b-4521-9435-5b3ce49d8fdb",
    "size": null,
    "tags": [],
    "parentMessageId": null,
    "holoPushAd": null,
    "jobId": null,
    "holoPushUrl": null
}

Click on the message to update it and then click the Save Draft button present at the bottom left corner after completion.

$ curl 'https://exchange-prod-g.2mee.com/notification/update'  -i -X PUT -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU4OTQ1NTc0OSwiaWF0IjoxNTg5NDM3NzQ5fQ.U2VtugGzqD0s9p0rUXaTxk8F5tHeMf5SB4ZRnYM8TV4QQm6y2FvdFIfD6kjQOhcYuPglSusAjVegzHqDKGgCqA'  -d '{
  "id" : "f4769c89-939b-4521-9435-5b3ce49d8fdb",
  "title" : "Title of the Message",
  "subtitle" : "SubTitle of the Message",
  "text" : "Body of the Message",
  "action" : "Open",
  "fbTitle" : "updated FallBack Title of the Message",
  "fbSubtitle" : "Fallback SubTitle of the Message",
  "fbText" : "FallBack Text of the Message",
  "expiry" : 1440,
  "playTime" :1582614107682,
  "about" : [ {
    "key" : "__openExternalURL",
    "value" : "https://2mee.com/"
  } ],
  "filterId" : "9e862fc2-e3b6-4420-bf63-80ad4368ec88",
  "priority" : "LOW",
  "favourite" : 0
}'

Text message upload metadata

POST https://exchange-prod-g.2mee.com/notification/upload

Upload a rich media file to the text message. You cannot upload a rich media file after scheduling the notification. notificationId and file to be uploaded are mandatory fields for rich media messages.

Path Parameters

NameTypeDescription

id

string

Id of the message to which rich media has to be uploaded.

Request Body

NameTypeDescription

file

object

This appears as rich media content in the notification.

{
    "appId": "bacb37d0-a51f-491b-bd68-489c245b8c16",
    "title": "Title of the Message",
    "subtitle": "SubTitle of the Message",
    "text": "Body of the Message",
    "action": "Open",
    "fbTitle": "updated FallBack Title of the Message",
    "fbSubtitle": "Fallback SubTitle of the Message",
    "fbText": "FallBack Text of the Message",
    "expiry": 1440,
    "playTime": 1582614107000,
    "about": [
        {
            "key": "__openExternalURL",
            "value": "https://2mee.com/"
        }
    ],
    "filterId": "9e862fc2-e3b6-4420-bf63-80ad4368ec88",
    "priority": "LOW",
    "favourite": 0,
    "type": "TEXT",
    "channel": "PUSH",
    "segment": null,
    "subType": "I",
    "createdBy": "479cec74-767e-4ecb-9e6d-ee508cadbd75",
    "state": "NEW",
    "companyId": "6c445333-bac9-4ab0-a0b6-cc6838902abb",
    "messageTitle": null,
    "url": "https://secureexchange.s3.eu-geo.objectstorage.softlayer.net/f4769c89-939b-4521-9435-5b3ce49d8fdb_d31da127-d00e-413c-9c3f-7a03af52b778.jpg",
    "id": "f4769c89-939b-4521-9435-5b3ce49d8fdb",
    "size": 13097,
    "tags": [],
    "parentMessageId": null,
    "holoPushAd": null,
    "jobId": null,
    "holoPushUrl": null
}

Below is an example of how this is done on the UI:

$ curl 'https://exchange-prod-g.2mee.com/notification/upload?id=notification/retarget?notificationId=f4769c89-939b-4521-9435-5b3ce49d8fdb&appId=bacb37d0-a51f-491b-bd68-489c245b8c16&engaged=ALLUSERS' 
-i -X POST  -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU4OTQ1NTc0OSwiaWF0IjoxNTg5NDM3NzQ5fQ.U2VtugGzqD0s9p0rUXaTxk8F5tHeMf5SB4ZRnYM8TV4QQm6y2FvdFIfD6kjQOhcYuPglSusAjVegzHqDKGgCqA'' 
-i -X POST -H 'Content-Type: multipart/form-data' -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0aW5ndGVhbUAybWVlLmNvbSIsImV4cCI6MTU4OTQ1NTc0OSwiaWF0IjoxNTg5NDM3NzQ5fQ.U2VtugGzqD0s9p0rUXaTxk8F5tHeMf5SB4ZRnYM8TV4QQm6y2FvdFIfD6kjQOhcYuPglSusAjVegzHqDKGgCqA' -F 'file=@0344a9cc-dda0-4fad-b1ef-9544bf8d750a_225bbed6-d7ca-4bad-99f1-df4bef1fe6dc.jpg;type=multipart/form-data' -F 'id=f4769c89-939b-4521-9435-5b3ce49d8fdb'

Last updated