Connection to API

Connection requirements

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/

Interaction model

The API uses the RESTful model, all the data are transferred as JSON objects.

Connection Parameters

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

ParameterDescription

host:port

Address and port of Cardsmobile host providing the API.

login:password

Username and password for API request authorization.

API Requests 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.

Request Structure And Format

All API requests expect the following in the request header:

Content-type ="application/json;charset=utf-8"

Image Format

Allowed format for images involved in API exchange: PNG or JPG. For image resolution requirements, refer to API requests documentation.

HTTP Response Codes

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

HTTP codeDescription

200 OK

API request is successfully processed.

If an error occurred during the request processing, the host will return an HTTP response containing a status code from the table below and the error description as a JSON object:

HTTP CodeDescription

400 Bad Request

Invalid request format/structure.

401 Unauthorized

Request authorization error.

403 Forbidden

Request authentication error (lack of rights to perform the request).

422 Unprocessable Entity

Business scenario processing error.

500 Internal Server Error

Problems on Cardsmobile server.

Error body

For any of the 4XX error codes described above, the response body contains a JSON object with fields code and details:

Content-Type: application/json
{
  "code": string, //Error code. Does not match HTTP status code. Human readable message in UPPER_SNAKE_CASE.
  "details": string //Error description in English. Not intended for display in UI.
}

Refer to API response documentation to review description of possible validation or business scenario processing errors.

Last updated