SMS Session Manager API

1. Introduction

The HORISEN SMS Session Manager API provides the ability to view and manage in real-time all Customers and Suppliers Connections on the Platform. Users can see Active Sessions and Stop/Restart them, respectively for Customer/Supplier connections.

This API belongs to the Bulk SMS Session Manager domain. The subject domain in the endpoint URL is:

https://api.horisen.pro/bulk/sms-session-manager/v1

The API uses the HORISEN implementation of the OAuth 2.0 protocol. For more information refer to the OAuth2 Authentication Guidelines page.

2. Methods Overview

2.1 SmsSessionManager

Endpoints for working with customers sessions.

GET/sess-manager
Returns a list of all customer sessions.Read More
GET/sess-manager/{id}
Returns an SMS customer session for a given ID.Read More

2.2 CustomerConnection

Endpoint for Customer Connections management.

PUT/customer-connections/{action}
Manages customer connections.Read More

2.3 SupplierGate

Endpoint for Supplier Gates management.

PUT/supplier-gates/{action}
Manages supplier gates.Read More

2.4 SmsSessionManagerSuppliers

Endpoints for working with suppliers sessions.

GET/sess-manager-suppliers
Returns a list of all supplier sessions.Read More
GET/sess-manager-suppliers/{id}
Returns an SMS supplier session for a given ID.Read More

3. Methods Details

3.1 SmsSessionManager

Endpoints for working with customer sessions.

GET/sess-manager
Returns a list of all customer sessions.Up
Method Overview

The method returns a list of all customer sessions.

Authorization privilege needed for this endpoint:
- sms-session-manager.view.

This endpoint accepts query parameters for filtering accounts described at URL Filtering Guidelines page.

URL Parameters
Name Type Description
all string (query) Returns all data for given criteria.
Available values: yes, no.
The default value: no.
page_size integer (query) A page size. The default value is 10.
page_number integer (query) A page number. The default value is 1.
paging string (query) Paging options. The format is: &paging=page_num,page_size. E.g. paging=1,10.
sort string (query) Sorting options. The format is: sort=-attribute1,attribute2,-attribute3.
operator(fieldName) string (query) Search criteria by using the following operators: isnull, isnotnull, isempty, isnotempty, eq, neq, startswith, contains, endswith, doesnotcontain, lt, lte, gt, gte, in, notin, between, notbetween, and the following attributes: accountName, ipAddr, serverAddr.

  • If the operator is one of isnull, isnotnull, isempty, isnotempty, a field value can be omitted.
  • If the operator is in or notin, a field value must be a comma separated list of values.
  • If the operator is between or notbetween, a field value must be a comma separated list of two values representing the beginning and the end of a range.
  • Operator can be omitted and in that case it will be treated as operator is 'eq' (E.g.: fieldName=fieldValue).
  • Example: startswith(clientName)=hor, starts with 'hor' in field clientName.
  • If fieldName is 'q' and operator is eq or omitted, a field value will be used in general search across multiple attributes.
Responses
Code Description Links
200 A list of SMS accounts. No links.
default Unexpected Error. No links.
Success Response 200: List of SMS Accounts
{
  "data": [
    {
      "sessionID": "string",
      "customer": "string",
      "accountName": "string",
      "accountID": 0,
      "ipAddr": "string",
      "serverAddr": "string",
      "blocked": true,
      "sessionStart": "string",
      "sessionLastTick": "string",
      "authName": "string",
      "protocol": "string",
      "protocolVersion": "string",
      "mode": "string",
      "state": "string",
      "ownerId": 0,
      "ownerBpName": "string",
      "ownerBpBriefName": "string"
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}
Error Response Unexpected Error: Default
{
  "Code": "string",
  "Message": "string"
}
GET/sess-manager/{id}
Returns an SMS customer session for a given ID.Up
Method Overview

The method returns an SMS customer session for a given ID.

Authorization privilege needed for this endpoint:
- sms-session-manager.view.

URL Parameters
Name Type Description
id (required) integer (path) Session ID.
Responses
Code Description Links
200 Session data. No links.
default Unexpected Error. No links.
Success Response 200: Session Data
{
  "sessionID": "string",
  "customer": "string",
  "accountName": "string",
  "accountID": 0,
  "ipAddr": "string",
  "serverAddr": "string",
  "blocked": true,
  "sessionStart": "string",
  "sessionLastTick": "string",
  "authName": "string",
  "protocol": "string",
  "protocolVersion": "string",
  "mode": "string",
  "state": "string",
  "ownerId": 0,
  "ownerBpName": "string",
  "ownerBpBriefName": "string"
}
Error Response Unexpected Error: Default
{
  "Code": "string",
  "Message": "string"
}

3.2 CustomerConnection

Endpoint for Customer Connections management.

PUT/customer-connections/{action}
Manages customer connections.Up
Method Overview

The method manages customer connections.

Authorization privilege needed for this endpoint:
- customer-connection-session-manager.manage.

List of possible errors:
- SESSION_MANAGER_NO_PLATFORM_PREFIX - Platform prefix not found.
- SESSION_MANAGER_AUTH_NAME_REQUIRED - Auth name is required.
- SESSION_MANAGER_ACTION_NOT_SUPPORTED - Given action not supported.
- SESSION_MANAGER_REDIS_NOT_FOUND - Redis not found.

URL Parameters
Name Type Description
action (required) string (path) An action to perform. Available value: stop.
put data (required) object (body) Data to put.
Data Parameters

Data object example

{
  "authName": "string"
}
Responses
Code Description Links
201 Action finished successfully. No links.
default Unexpected Error. No links.
Success Response 201: Action Finished Successfully
{
  "authName": "string"
}
Error Response Unexpected Error: Default
{
  "Code": "string",
  "Message": "string"
}

3.3 SupplierGate

Endpoint for Supplier Gates management.

PUT/supplier-gates/{action}
Manages supplier gates.Up
Method Overview

The method manages supplier gates.

Authorization privilege needed for this endpoint:
- supplier-gate-session-manager.manage.

List of possible errors:
- SESSION_MANAGER_NO_PLATFORM_PREFIX - Platform prefix not found.
- SESSION_MANAGER_CNAME_REQUIRED - Code name is required.
- SESSION_MANAGER_ACTION_NOT_SUPPORTED - Given action not supported.
- SESSION_MANAGER_REDIS_NOT_FOUND - Redis not found.

URL Parameters
Name Type Description
action (required) string (path) An action to perform. Available value: restart.
put data (required) object (body) Data to put.
Data Parameters

Data object example

{
  "cName": "string"
}
Responses
Code Description Links
201 Action finished successfully. No links.
default Unexpected Error. No links.
Success Response 201: Action Finished Successfully
{
  "cName": "string"
}
Error Response Unexpected Error: Default
{
  "Code": "string",
  "Message": "string"
}

3.4 SmsSessionManagerSuppliers

Endpoints for working with suppliers sessions.

GET/sess-manager-suppliers
Returns a list of all supplier sessions.Up
Method Overview

The method returns a list of all supplier sessions.

Authorization privilege needed for this endpoint:
- sms-supplier-session-manager.view.

URL Parameters
Name Type Description
operator(fieldName) string (query) Search criteria by using the following operators: isnull, isnotnull, isempty, isnotempty, eq, neq, startswith, contains, endswith, doesnotcontain, lt, lte, gt, gte, in, notin, between, notbetween, and the following attributes: ownerId, ownerBpName.

  • If the operator is one of isnull, isnotnull, isempty, isnotempty, a field value can be omitted.
  • If the operator is in or notin, a field value must be a comma separated list of values.
  • If the operator is between or notbetween, a field value must be a comma separated list of two values representing the beginning and the end of a range.
  • Operator can be omitted and in that case it will be treated as operator is 'eq' (E.g.: fieldName=fieldValue).
  • Example: startswith(clientName)=hor, starts with 'hor' in field clientName.
  • If fieldName is 'q' and operator is eq or omitted, a field value will be used in general search across multiple attributes.
Responses
Code Description Links
200 List of SMS accounts. No links.
default Unexpected Error. No links.
Success Response 200: List of SMS Accounts
{
  "data": [
    {
      "sessionID": "string",
      "gateID": 0,
      "connID": 0,
      "instNum": 0,
      "sessionType": "string",
      "startDT": "string",
      "status": "string",
      "lastTickDT": "string",
      "protocolVersion": "string",
      "supplier": "string",
      "gateName": "string",
      "connectionName": "string",
      "remoteHost": "string",
      "remotePort": 0,
      "localHost": "string",
      "localPort": 0,
      "gateCName": "string",
      "connectionCName": "string",
      "ownerId": 0,
      "ownerBpName": "string",
      "ownerBpBriefName": "string"
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}
Error Response Unexpected Error: Default
{
  "Code": "string",
  "Message": "string"
}
GET/sess-manager-suppliers/{id}
Returns an SMS supplier session for a given ID.Up
Method Overview

The method returns an SMS supplier session for a given ID.

Authorization privilege needed for this endpoint:
- sms-supplier-session-manager.view.

URL Parameters
Name Type Description
id (required) integer (path) Supplier session ID.
Responses
Code Description Links
200 Supplier session data. No links.
default Unexpected Error. No links.
Success Response 200: Supplier Session Data
{
  "sessionID": "string",
  "gateID": 0,
  "connID": 0,
  "instNum": 0,
  "sessionType": "string",
  "startDT": "string",
  "status": "string",
  "lastTickDT": "string",
  "protocolVersion": "string",
  "supplier": "string",
  "gateName": "string",
  "connectionName": "string",
  "remoteHost": "string",
  "remotePort": 0,
  "localHost": "string",
  "localPort": 0,
  "gateCName": "string",
  "connectionCName": "string",
  "ownerId": 0,
  "ownerBpName": "string",
  "ownerBpBriefName": "string"
}
Error Response Unexpected Error: Default
{
  "Code": "string",
  "Message": "string"
}

4. Data Models

Data Models define the structure of a JSON document.

4.1 Data

Data describe the data related to the Session Manager API.

CustomerConnectionRes object properties:

Name Type Description
authName string Customer auth name.

CustomerConnectionPut object properties:

Name Type Description
authName string Customer auth name.
JSON example
{
  "authName": "string"
}

SmsSessionCollection object properties:

Name Type Description
data (required) array An array of SmsSession objects.
meta (required) object CollectionMeta object.

SmsSession object properties:

Name Type Description
sessionID string Customer session ID.
customer string Customer name.
accountName string Account name.
accountID integer Account ID.
ipAddr string IP address.
serverAddr string Server address.
blocked boolean If customer connection is blocked.
sessionStart string Date and time of the session start.
sessionLastTick string Session last tick.
authName string Authentication name that is used for a connection.
protocol string Protocol.
protocolVersion string Protocol version.
mode string Mode of a protocol.
state string State of a session.
ownerId integer Owner ID.
ownerBpName string Owner business partner name.
ownerBpBriefName string Owner business partner brief name.
JSON example
{
  "data": [
    {
      "sessionID": "string",
      "customer": "string",
      "accountName": "string",
      "accountID": 0,
      "ipAddr": "string",
      "serverAddr": "string",
      "blocked": true,
      "sessionStart": "string",
      "sessionLastTick": "string",
      "authName": "string",
      "protocol": "string",
      "protocolVersion": "string",
      "mode": "string",
      "state": "string",
      "ownerId": 0,
      "ownerBpName": "string",
      "ownerBpBriefName": "string"
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}

SupplierGateRes object properties:

Name Type Description
cName string Supplier gate code name.

SupplierGatePut object properties:

Name Type Description
cName string Supplier gate code name.
JSON example
{
  "cName": "string"
}

SmsSessionSupplierCollection object properties:

Name Type Description
data (required) array An array of SmsSessionSupplier objects.
meta (required) object CollectionMeta object.

SmsSessionSupplier object properties:

Name Type Description
sessionID string Supplier Session ID.
gateID integer Gate ID.
connID integer Connection ID.
instNum integer Instance number.
sessionType string Session type.
startDT string Date and time of the session start.
status string Status of supplier session.
lastTickDT string Date and time of last tick.
protocolVersion string Protocol version.
supplier string Supplier name.
gateName string Gate name.
connectionName string Connection name.
remoteHost string Remote host.
remotePort integer Remote port.
localHost string Local host.
localPort integer Local port.
gateCName string Gate code name.
connectionCName string Connection code name.
ownerId integer Owner ID.
ownerBpName string Owner business partner name.
ownerBpBriefName string Owner business partner brief name.
JSON example
{
  "data": [
    {
      "sessionID": "string",
      "gateID": 0,
      "connID": 0,
      "instNum": 0,
      "sessionType": "string",
      "startDT": "string",
      "status": "string",
      "lastTickDT": "string",
      "protocolVersion": "string",
      "supplier": "string",
      "gateName": "string",
      "connectionName": "string",
      "remoteHost": "string",
      "remotePort": 0,
      "localHost": "string",
      "localPort": 0,
      "gateCName": "string",
      "connectionCName": "string",
      "ownerId": 0,
      "ownerBpName": "string",
      "ownerBpBriefName": "string"
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}

Error object properties:

Name Type Description
code (required) string Error code.
message (required) string Error message.
JSON Example
{
  "code": "string",
  "message": "string"
}

4.2 Meta

Meta contains data for the number of rows and pages that have been received for a given API call.

CollectionMeta object properties:

Name Type Description
pagination (required) object CollectionMetaPagination object.

CollectionMetaPagination object properties:

Name Type Description
total (required) integer Total number of rows.
count (required) integer A number of rows in the current page.
per_page (required) integer The maximum rows per page.
current_page (required) integer The current page number.
total_pages (required) integer Total number of pages.
links (required) object CollectionMetaPaginationLinks object.

CollectionMetaPaginationLinks object properties:

Name Type Description
first string Link to the first page.
last string Link to the last page.
prev string Link to the previous page.
next string Link to the next page.
JSON example
"meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }