API Requests

Sending single or batch push messages

Documentation has moved

The information on this page is no longer updated and may be obsolete. The most current Koshelek documentation is now available at the new address:

https://developers.koshelek.app/en/

Push API

Send Single Push Message

POST https://api.cardsmobile.ru/push/delivery

The request is used by a partner to send a single push message (transactional, service or advertising) to a certain recipient.

Request Body

NameTypeDescription

pushType*

string

Type of the message: TRANSACTION — for transactional; SERVICE — for service; PROMO — for advertising.

msisdn*

integer

Recipient phone number without the + prefix.

payload*

object

Message to be sent (JSON object Payload).

qos

object

Message delivery settings (JSON object QoS).

utm

object

Additional delivery settings (JSON object UTM).

{
  "messageId": "UUID",
  "state": "MSISDN_NOT_REGISTERED|ENQUEUED"
}

For description of Payload, QoS and QoS objects, see API Objects.

If a push message was not sent due to sending rate limit exceeding, attempt to send the message later.

Example of request body:

{
    "pushType": "TRANSACTION",
    "msisdn": 71234567890,
    "payload": {
        "title": "Bonus points written off",
        "message": "Your card balance is reduced by 10 bonuses",
        "image": "http://partnerdomain/logo.jpg",
        "deeplink": {
            "target": "card"
        }
    },
    "qos": {
        "deliveryStatusNotifications": true
    }
}

Single Push Message Bulk Sending

POST https://api.cardsmobile.ru/bulk/single

The request is used by a partner to send a single push message (transactional, service or advertising) to a certain list of recipients.

Request Body

NameTypeDescription

pushType*

string

Type of the message: TRANSACTION — for transactional message; SERVICE — for service; PROMO — for advertising.

msisdn*

array

Array of recipient phone numbers. Integers without the + prefix.

payload*

object

Message to be sent (JSON object Payload, see above).

qos

object

Message delivery settings (JSON object QoS, see above).

utm

object

Additional delivery settings (JSON object UTM, see above).

[
  {
    "msisdn": MSISDN,
    "messageId": "UUID",
    "state": "MSISDN_NOT_REGISTERED|ENQUEUED"
  }, ...
]

Example of request body:

{
  "pushType": "TRANSACTION",
  "msisdn": [
    79001234567,
    79001234578,
    79001234589,
    79001234590
  ],
  "payload": {
    "title": "Bonus points written off",
    "message": "Your card balance is reduced by 10 bonuses",
    "image": "http://partnerdomain/logo.jpg",
    "deeplink": {
      "target": "card"
    }
  },
  "qos": {
    "deliveryStatusNotifications": true
  },
  "utm": {
    "utmSource": "cardsmobile",
    "utmMiddle": "cpc",
    "utmCampaign": "campaign_name"
  }
}

Multiple Push Messages Bulk Sending

POST https://api.cardsmobile.ru/bulk/multi

The request is used by a partner to send several push messages (transactional, service or advertising) to several recipients at once (one message to one recipient).

Request Body

NameTypeDescription

*

array

Array of JSON objects describing a push message to be sent (body of a /delivery request, see above).

[
  {
    "msisdn": MSISDN,
    "messageId": "UUID",
    "state": "MSISDN_NOT_REGISTERED|ENQUEUED"
  }, ...
]

Example of request body:

[
  {
    "pushType": "TRANSACTION",
    "msisdn": 71234567890,
    "payload": {
        "title": "Bonus points written off",
        "message": "Your card balance is reduced by 10 bonuses",
        "image": "http://partnerdomain/logo.jpg",
        "deeplink": {
            "target": "card"
        }
    },
    "qos": {
        "deliveryStatusNotifications": true
    }
  }
]

Get Promotional Action List From Personal Account

GET https://api.cardsmobile.ru/promos

A partner that has an account in Koshelek for Business can set up and publish promotional actions for the customers in the Koshelek app. This API method allows to get identifiers of current active promotional actions which can be used for setting up a redirection from a push message to the screen of the corresponding offer in the Koshelek app.

{
    "promos": [
        {
            "id": <promo action ID>,
            "name": "Promo action name",
            "active": true
        },
        {
            "id": <promo action ID>,
            "name": "Promo action name",
            "active": true
        }
    ]
}

Body of the request is empty.

Get Delivery Status For a Single Message

GET https://api.cardsmobile.ru/push/{messageId}/transactional-state

The method is used to get the delivery status of a certain single push message.

Path Parameters

NameTypeDescription

messageId*

string

ID of the message.

{
    "states": [
        {
            "msisdn": <MSISDN>,
            "state": "MSISDN_NOT_REGISTERED|ENQUEUED|DELIVERED|OPENED",
            "time": "yyyy-MM-ddThh:mm:ssZ"
        },
        {
            "msisdn": <MSISDN>,
            "state": "MSISDN_NOT_REGISTERED|ENQUEUED|DELIVERED|OPENED",
            "time": "yyyy-MM-ddThh:mm:ssZ"
        }
    ]
}

Callback API

Inform About Changing Delivery Status

POST https://<partner-base-url>/<callback-endpoint>

If the delivery is created with the "true" value of deliveryStatusNotifications parameter, the Cardsmobile host will call URL specified by the partner during the integration at each changing of push message status (refer to Connection to API).

Request Body

NameTypeDescription

msisdn*

integer

Phone number of recipient without the + prefix.

messageId*

string

ID of the message.

state*

string

Current delivery status of the message: DELIVERED — if the message is delivered to user's device; OPENED — if the message has opened by user.

time

string

Time ("yyyy-MM-ddThh:mm:ssZ") when the message got the status.

utm

object

Object identifier with additional parameters for the delivery (as set upon delivery creation — see above).

Example of request body:

{
    "msisdn": 79051234567,
    "messageId": "c506b550-a309-11e9-a2a3-2a2ae2dbcce4",
    "state": "DELIVERED",
    "time": "2019-11-29T17:11:42Z",
    "utm": {
           "utmSource": "cardsmobile",
           "utmMiddle": "cpc",
           "utmCampaign": "campaign_name"
  }
}

Last updated