Skip to content

Push API v1.0.0

API for sending push messages (single, batch) to the Koshelek App users.


General information

The manual is intended for partner companies of Bescontact LLC that provide loyalty cards issuance in the Koshelek app using the Koshelek platform.

Push API provides the partner with an interface for sending push messages to customer devices.

Interaction model

The API uses the RESTful model (all the data is transferred as JSON objects). The feature of this model is that a partner and Koshelek use two interfaces for the interaction:

  • Push API — used by the partner to send push messages.
  • Callback API — used by Koshelek to transmit information on push messages delivery and reading by recipient to the partner.

Partner and Koshelek interaction model

Connecting to API

Push API is provided by Koshelek host. The following request parameters are provided for a partner in order to get access:

Parameter Description
host:port Address and port of the Koshelek host providing the API.
login:password Username and password for API requests authorization.

Number of accounts is not restricted. Still, each account determines the following:

  • A partner whose clients will receive push messages.
  • A Callback API URL for sending the information on push messages delivery and reading status.

Authorization

The HTTPS protocol is used. HTTP Basic Authentication (RFC 7617) mechanism should be used for API requests authorization. Credentials for authorization are transferred in the Authorization HTTP header.

Encoding

Both API requests and responses should use the UTF-8 encoding.

HTTP codes

If the request is successfully processed, the Koshelek host returns an HTTP response containing the status code 200, and the body with a payload described in the request documentation.

HTTP code Description
200 API request is successfully processed.

If an error occurred during the request processing, the host returns an HTTP response containing one of the status codes from the table below, and the error description as a JSON object in the body (the UTF-8 encoding is used):

HTTP Code Description
304 New request came earlier than expected.
400 Invalid request format.
401 Authorization error.
404 Requested data not found.

Response body examples, HTTP code 400:

JSON
{
    "status": "BAD_REQUEST",
    "errors": [
        "msisdn: size must be between 0 and 10000",
        "subId: may not be null"
    ]
}

Response body examples, HTTP code 400:

JSON
{
    "status": "UNAUTHORIZED",
    "errors": [
        "Auth token is invalid"
    ]
}