{
    "openapi": "3.1.0",
    "info": {
        "title": "Mobica Ltd. - Gate OpenAPI",
        "version": "2.0.0",
        "description": "Application programming interface (API) for messaging.\n\n### Authentication\n\nThis API supports two methods of authentication:\n\n1. **HTTP Basic Authentication (Preferred)**: Send your credentials in the `Authorization` header. This is the **more secure and recommended** way to authenticate.\n2. **Request Parameters**: Alternatively, you can pass `user` and `pass` in the request body or as query parameters. This method is less recommended.\n\nSome useful links:\n- [Mobica Ltd.](https://mobica.bg/)\n- [GSM 03.38](https://en.wikipedia.org/wiki/GSM_03.38)\n- [User Data Header (UDH)](https://en.wikipedia.org/wiki/User_Data_Header)\n- [Short Message Peer-to-Peer (SMPP)](https://en.wikipedia.org/wiki/Short_Message_Peer-to-Peer)\n- [OpenAPI 3.1.0](https://spec.openapis.org/oas/v3.1.0)\n- [Swagger Editor](https://editor-next.swagger.io/)",
        "termsOfService": "https://mobica.bg/en/general-terms",
        "contact": {
            "name": "support@mobica.bg",
            "email": "support@mobica.bg",
            "url": "https://mobica.bg/en/contact"
        }
    },
    "servers": [
        {
            "url": "https://gate.mobica.bg/v2/",
            "description": "Production"
        }
    ],
    "tags": [
        {
            "name": "SMS",
            "description": "Short Message Service (SMS) requests."
        },
        {
            "name": "HLR",
            "description": "Home Location Register Lookup (HLR Lookup) requests."
        },
        {
            "name": "Viber",
            "description": "Viber requests."
        },
        {
            "name": "System",
            "description": "System information."
        },
        {
            "name": "DLR",
            "description": "Delivery Report (DLR) requests."
        }
    ],
    "paths": {
        "/health.php": {
            "get": {
                "tags": [
                    "System"
                ],
                "summary": "System health check",
                "description": "Returns application health status.",
                "responses": {
                    "200": {
                        "description": "Application is healthy.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "system_message": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Application is unhealthy (Service Unavailable).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "system_message": {
                                            "type": "string",
                                            "example": "The application is in maintenance mode."
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/multi/json/dlr_reference_id.php": {
            "post": {
                "tags": [
                    "DLR"
                ],
                "summary": "Delivery Report (DLR) By Reference ID",
                "description": "Retrieve delivery status information.",
                "security": [
                    {
                        "BasicAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/HeaderSwagger"
                    }
                ],
                "requestBody": {
                    "description": "The body of the DLR retrieve request.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/RetrieveMultiJsonDlrReferenceId"
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "$ref": "#/components/responses/RetrieveMultiJsonDlrReferenceIdAccepted"
                    },
                    "3XX": {
                        "$ref": "#/components/responses/Redirect"
                    },
                    "4XX": {
                        "$ref": "#/components/responses/AuthenticationError"
                    },
                    "5XX": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/multi/json/hlr.php": {
            "post": {
                "tags": [
                    "HLR"
                ],
                "summary": "Home Location Register Lookup (HLR Lookup)",
                "description": "Send multi HLR with one request.",
                "security": [
                    {
                        "BasicAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/HeaderSwagger"
                    }
                ],
                "requestBody": {
                    "description": "The body of the HLR send request.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendMultiJsonHlr"
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "$ref": "#/components/responses/Accepted"
                    },
                    "3XX": {
                        "$ref": "#/components/responses/Redirect"
                    },
                    "4XX": {
                        "$ref": "#/components/responses/ServiceHlrError"
                    },
                    "5XX": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/multi/json/sms.php": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Short Message Service (SMS)",
                "description": "Send multi SMS with one request.",
                "security": [
                    {
                        "BasicAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/HeaderSwagger"
                    }
                ],
                "requestBody": {
                    "description": "The body of the SMS send request.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendMultiJsonSms"
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "$ref": "#/components/responses/Accepted"
                    },
                    "3XX": {
                        "$ref": "#/components/responses/Redirect"
                    },
                    "4XX": {
                        "$ref": "#/components/responses/ServiceSmsError"
                    },
                    "5XX": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/multi/json/viber.php": {
            "post": {
                "tags": [
                    "Viber"
                ],
                "summary": "Viber Message Service",
                "description": "Send multi Viber with one request.",
                "security": [
                    {
                        "BasicAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/HeaderSwagger"
                    }
                ],
                "requestBody": {
                    "description": "The body of the Viber send request.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendMultiJsonViber"
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "$ref": "#/components/responses/Accepted"
                    },
                    "3XX": {
                        "$ref": "#/components/responses/Redirect"
                    },
                    "4XX": {
                        "$ref": "#/components/responses/ServiceViberError"
                    },
                    "5XX": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/user/account_balance.php": {
            "post": {
                "tags": [
                    "System"
                ],
                "summary": "Account Balance",
                "description": "Send a request to check the account balance. Values are updated every 10 minutes.",
                "security": [
                    {
                        "BasicAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/HeaderSwagger"
                    }
                ],
                "requestBody": {
                    "description": "The body of the request.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Authentication"
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "This class of status codes indicates the action requested by the client was received, understood, and accepted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "username": {
                                            "type": "string",
                                            "description": "The username."
                                        },
                                        "amount": {
                                            "type": "string",
                                            "description": "The amount."
                                        },
                                        "currency": {
                                            "type": "string",
                                            "description": "The currency."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "3XX": {
                        "$ref": "#/components/responses/Redirect"
                    },
                    "4XX": {
                        "$ref": "#/components/responses/AuthenticationError"
                    },
                    "5XX": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/viber/templates/send.php": {
            "post": {
                "tags": [
                    "Viber"
                ],
                "summary": "Send Viber Template Message",
                "description": "Send a Viber message using a pre-approved Viber Template",
                "operationId": "sendViberTemplate",
                "security": [
                    {
                        "BasicAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/HeaderSwagger"
                    }
                ],
                "requestBody": {
                    "description": "The body of the Viber Template send request.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendViberTemplate"
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "$ref": "#/components/responses/Accepted"
                    },
                    "3XX": {
                        "$ref": "#/components/responses/Redirect"
                    },
                    "4XX": {
                        "$ref": "#/components/responses/ServiceViberTemplateError"
                    },
                    "5XX": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        },
        "/viber/templates/check.php": {
            "post": {
                "tags": [
                    "Viber"
                ],
                "summary": "Check Viber Template",
                "description": "Retrieve Viber Template information by identifier.",
                "security": [
                    {
                        "BasicAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/HeaderSwagger"
                    }
                ],
                "requestBody": {
                    "description": "The body of Viber Template check request.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CheckViberTemplateById"
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "$ref": "#/components/responses/CheckViberTemplateByIdAccepted"
                    },
                    "3XX": {
                        "$ref": "#/components/responses/Redirect"
                    },
                    "4XX": {
                        "$ref": "#/components/responses/AuthenticationError"
                    },
                    "5XX": {
                        "$ref": "#/components/responses/ServerError"
                    }
                }
            }
        }
    },
    "webhooks": {
        "DLR": {
            "get": {
                "tags": [
                    "DLR"
                ],
                "summary": "Callback Delivery Report (DLR)",
                "description": "Automatic filling of information about delivery statuses. Provide us with a web address to receive a GET request from us with a delivery report status of your message.",
                "parameters": [
                    {
                        "in": "query",
                        "name": "id",
                        "required": true,
                        "description": "Unique identification number.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "phone",
                        "description": "Phone number with country code.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "in": "query",
                        "name": "channel",
                        "required": true,
                        "description": "The service used to send the message (sms, viber, telegram...).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "status",
                        "required": true,
                        "description": "The status code.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "in": "query",
                        "name": "desc",
                        "required": true,
                        "description": "The status description.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "date",
                        "required": true,
                        "description": "Date and time of the message (Y-m-d H:i:s).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "reason",
                        "required": false,
                        "description": "Additional information from the services.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "reply_text",
                        "required": false,
                        "description": "Two-way answer.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "reply_date",
                        "required": false,
                        "description": "Two-way date.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Return a HTTP status code 200 status to indicate that the data was received successfully."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "BasicAuth": {
                "type": "http",
                "scheme": "basic"
            }
        },
        "parameters": {
            "HeaderSwagger": {
                "in": "header",
                "name": "X-Swagger",
                "description": "Used to detect tests from the documentation. Not required in a production environment.",
                "required": true,
                "schema": {
                    "type": "integer",
                    "default": 1,
                    "format": "int32"
                }
            }
        },
        "schemas": {
            "Authentication": {
                "type": "object",
                "required": [
                    "user",
                    "pass"
                ],
                "properties": {
                    "user": {
                        "type": "string",
                        "description": "Username. (Optional if HTTP Basic Auth is used)",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "pass": {
                        "type": "string",
                        "description": "Password. (Optional if HTTP Basic Auth is used)",
                        "format": "password",
                        "minLength": 6,
                        "maxLength": 100
                    }
                }
            },
            "RetrieveMultiJsonDlrReferenceId": {
                "type": "object",
                "required": [
                    "user",
                    "pass",
                    "dlr"
                ],
                "properties": {
                    "user": {
                        "type": "string",
                        "description": "Username. (Optional if HTTP Basic Auth is used)",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "pass": {
                        "type": "string",
                        "description": "Password. (Optional if HTTP Basic Auth is used)",
                        "format": "password",
                        "minLength": 6,
                        "maxLength": 100
                    },
                    "dlr": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 1000,
                        "items": {
                            "type": "object",
                            "required": [
                                "reference_id"
                            ],
                            "properties": {
                                "reference_id": {
                                    "type": "string",
                                    "description": "Unique identification number. It serves to receive a DLR.",
                                    "maxLength": 255
                                }
                            }
                        }
                    }
                }
            },
            "SendMultiJsonHlr": {
                "type": "object",
                "required": [
                    "user",
                    "pass",
                    "hlr"
                ],
                "properties": {
                    "user": {
                        "type": "string",
                        "description": "Username. (Optional if HTTP Basic Auth is used)",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "pass": {
                        "type": "string",
                        "description": "Password. (Optional if HTTP Basic Auth is used)",
                        "format": "password",
                        "minLength": 6,
                        "maxLength": 100
                    },
                    "hlr": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 1000,
                        "items": {
                            "type": "object",
                            "required": [
                                "number"
                            ],
                            "properties": {
                                "number": {
                                    "type": "integer",
                                    "description": "Phone number with country code."
                                },
                                "reference": {
                                    "type": "string",
                                    "description": "Unique identification number. It serves to receive a DLR.",
                                    "maxLength": 30
                                },
                                "url": {
                                    "type": "string",
                                    "description": "A valid URL that will be used to receive the statuses.",
                                    "maxLength": 300
                                },
                                "email": {
                                    "type": "string",
                                    "description": "A valid email that will be used to receive the statuses.",
                                    "maxLength": 300
                                }
                            }
                        }
                    }
                }
            },
            "SendMultiJsonSms": {
                "type": "object",
                "required": [
                    "user",
                    "pass",
                    "sms"
                ],
                "properties": {
                    "user": {
                        "type": "string",
                        "description": "Username. (Optional if HTTP Basic Auth is used)",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "pass": {
                        "type": "string",
                        "description": "Password. (Optional if HTTP Basic Auth is used)",
                        "format": "password",
                        "minLength": 6,
                        "maxLength": 100
                    },
                    "sms": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 1000,
                        "items": {
                            "type": "object",
                            "required": [
                                "phone",
                                "message"
                            ],
                            "properties": {
                                "phone": {
                                    "type": "integer",
                                    "description": "Phone number with country code."
                                },
                                "message": {
                                    "type": "string",
                                    "description": "SMS message.",
                                    "maxLength": 1600
                                },
                                "idd": {
                                    "type": "string",
                                    "description": "Unique identification number. It serves to receive a DLR.",
                                    "maxLength": 45
                                },
                                "from": {
                                    "type": "string",
                                    "description": "Message sender (Sender ID). There is a limit up to 11 symbols, if your route allows an alpha sender. If not provided, a default will be used. Your client is set by an administrator.",
                                    "maxLength": 20
                                },
                                "route": {
                                    "type": "integer",
                                    "description": "Package number. If not provided, it will go via the package that is configured by default.",
                                    "format": "int32"
                                },
                                "priority": {
                                    "type": "integer",
                                    "description": "User priority. The highest priority is 255.",
                                    "format": "int32"
                                },
                                "smartCut": {
                                    "type": "integer",
                                    "enum": [
                                        0,
                                        1
                                    ],
                                    "default": 0,
                                    "description": "Splitting long messages. 0 - simple split by length. 1 - correct presentation on the end device (additional message can be added).",
                                    "format": "int32"
                                },
                                "toDate": {
                                    "type": "string",
                                    "description": "Format of the future date (YYYY-mm-dd h:min) on which the message will be delivered. If not provided, delivery is immediate."
                                }
                            }
                        }
                    }
                }
            },
            "SendMultiJsonViber": {
                "type": "object",
                "required": [
                    "user",
                    "pass",
                    "viber"
                ],
                "properties": {
                    "user": {
                        "type": "string",
                        "description": "Username. (Optional if HTTP Basic Auth is used)",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "pass": {
                        "type": "string",
                        "description": "Password. (Optional if HTTP Basic Auth is used)",
                        "format": "password",
                        "minLength": 6,
                        "maxLength": 100
                    },
                    "viber": {
                        "type": "array",
                        "description": "Parameters text, button caption + button action, image and carousel make Viber Service Message content. \nThere are 5 possible combinations of Viber Message Service content:\n  - Text only (transactional)\n  - Image only (promotional)\n  - Text + Button (promotional)\n  - Text + Button + Image (promotional)\n  - Text + Carousel (promotional)",
                        "minItems": 1,
                        "maxItems": 1000,
                        "items": {
                            "type": "object",
                            "required": [
                                "phone"
                            ],
                            "properties": {
                                "phone": {
                                    "type": "integer",
                                    "description": "Phone number with country code."
                                },
                                "text": {
                                    "type": "string",
                                    "description": "Viber message.",
                                    "maxLength": 1000
                                },
                                "idd": {
                                    "type": "string",
                                    "description": "Unique identification number. It serves to receive a DLR.",
                                    "maxLength": 255
                                },
                                "tag": {
                                    "type": "string",
                                    "description": "Sender, tag or display name.",
                                    "maxLength": 255
                                },
                                "image_url": {
                                    "type": "string",
                                    "description": "The URL address of image sent to end user. The VIBER image can be sent alone or together with text and button.",
                                    "maxLength": 1000
                                },
                                "button_text": {
                                    "type": "string",
                                    "description": "A textual writing on the button. Maximum length is 20 characters.The VIBER button can be sent only if Viber Message Service contains text.",
                                    "maxLength": 20
                                },
                                "button_url": {
                                    "type": "string",
                                    "description": "The link of button action.",
                                    "maxLength": 1000
                                },
                                "validity_period_sec": {
                                    "type": "integer",
                                    "description": "TTL value in seconds (range - 15 to 86400). If the Viber Message Service can’t be delivered within given seconds, we will send an SMS message as a fallback.",
                                    "format": "int32",
                                    "minimum": 15,
                                    "maximum": 86400
                                },
                                "sms_text": {
                                    "type": "string",
                                    "description": "This text will be received via SMS if Viber message is not delivered.",
                                    "maxLength": 1600
                                },
                                "is_promotional": {
                                    "type": "integer",
                                    "enum": [
                                        0,
                                        1
                                    ],
                                    "default": 0,
                                    "description": "Indicates if content is of promotional character.",
                                    "format": "int32"
                                },
                                "toDate": {
                                    "type": "string",
                                    "description": "Format of the future date (YYYY-mm-dd h:min) on which the message will be delivered. If not provided, delivery is immediate."
                                },
                                "payload": {
                                    "type": "object",
                                    "properties": {
                                        "carousel": {
                                            "type": "object",
                                            "description": "\"Viber Carousel\" is an ad format on Viber that allows the display of multiple images or offers in a single ad, through which the user can scroll horizontally.",
                                            "properties": {
                                                "items": {
                                                    "type": "array",
                                                    "description": "Each slide in the carousel can have its own image, title, description, and action buttons.",
                                                    "minItems": 2,
                                                    "maxItems": 5,
                                                    "items": {
                                                        "type": "object",
                                                        "required": [
                                                            "title",
                                                            "image_url",
                                                            "primary_button"
                                                        ],
                                                        "properties": {
                                                            "title": {
                                                                "type": "string",
                                                                "description": "The title of the carousel card. This is plain text up to 38 Unicode characters.",
                                                                "maxLength": 38
                                                            },
                                                            "image_url": {
                                                                "type": "string",
                                                                "description": "The URL of an image for each carousel card.",
                                                                "maxLength": 1000
                                                            },
                                                            "primary_button": {
                                                                "type": "object",
                                                                "description": "The primary button for each carousel card.",
                                                                "properties": {
                                                                    "button_text": {
                                                                        "type": "string",
                                                                        "description": "This is the text displayed on the primary button of the carousel card. This can be up to 10 Unicode characters.",
                                                                        "maxLength": 10
                                                                    },
                                                                    "button_url": {
                                                                        "type": "string",
                                                                        "description": "The URL scheme of the action triggered by the primary button.",
                                                                        "maxLength": 1000
                                                                    }
                                                                }
                                                            },
                                                            "secondary_button": {
                                                                "type": "object",
                                                                "description": "The secondary button for each carousel card. The secondary button is optional.",
                                                                "properties": {
                                                                    "button_text": {
                                                                        "type": "string",
                                                                        "description": "This is the text displayed on the secondary button of the carousel card. This can be up to 12 Unicode characters. Note that the text length is a bit larger than the text allowed in the primary button.",
                                                                        "maxLength": 12
                                                                    },
                                                                    "button_url": {
                                                                        "type": "string",
                                                                        "description": "The URL scheme of the action triggered by the secondary button.",
                                                                        "maxLength": 1000
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "SendViberTemplate": {
                "type": "object",
                "required": [
                    "user",
                    "pass",
                    "viber"
                ],
                "properties": {
                    "user": {
                        "type": "string",
                        "description": "Username. (Optional if HTTP Basic Auth is used)",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "pass": {
                        "type": "string",
                        "description": "Password. (Optional if HTTP Basic Auth is used)",
                        "format": "password",
                        "minLength": 6,
                        "maxLength": 100
                    },
                    "msisdn": {
                        "type": "integer",
                        "description": "Mobile Station International Subscriber Directory Number (MSISDN / Phone Number) with country code."
                    },
                    "reference_id": {
                        "type": "string",
                        "description": "Unique identification number. It serves to receive a DLR.",
                        "maxLength": 255
                    },
                    "viber": {
                        "type": "object",
                        "required": [
                            "template_id"
                        ],
                        "properties": {
                            "template_id": {
                                "type": "integer",
                                "description": "Unique template identification number"
                            },
                            "template_parameters": {
                                "type": "object",
                                "description": "Template parameters.",
                                "maxItems": 8,
                                "additionalProperties": {
                                    "type": "string",
                                    "maxLength": 125
                                },
                                "example": {
                                    "name": "Unknown",
                                    "pin": "123456"
                                }
                            },
                            "sender": {
                                "type": "string",
                                "description": "Sender, tag or display name.",
                                "maxLength": 255
                            },
                            "validity_period_sec": {
                                "type": "integer",
                                "description": "TTL value in seconds (range - 15 to 86400). If the Viber Message Service can’t be delivered within given seconds, we will send an SMS message as a fallback.",
                                "format": "int32",
                                "minimum": 15,
                                "maximum": 86400
                            },
                            "sms_fallback_text": {
                                "type": "string",
                                "description": "This text will be received via SMS if Viber message is not delivered.",
                                "maxLength": 1600
                            },
                            "scheduled_at": {
                                "type": "string",
                                "description": "Format of the future date (YYYY-mm-dd h:min) on which the message will be delivered. If not provided, delivery is immediate."
                            }
                        }
                    }
                }
            },
            "CheckViberTemplateById": {
                "type": "object",
                "required": [
                    "user",
                    "pass",
                    "viber"
                ],
                "properties": {
                    "user": {
                        "type": "string",
                        "description": "Username. (Optional if HTTP Basic Auth is used)",
                        "minLength": 3,
                        "maxLength": 50
                    },
                    "pass": {
                        "type": "string",
                        "description": "Password. (Optional if HTTP Basic Auth is used)",
                        "format": "password",
                        "minLength": 6,
                        "maxLength": 100
                    },
                    "viber": {
                        "type": "object",
                        "required": [
                            "template_id"
                        ],
                        "properties": {
                            "template_id": {
                                "type": "integer",
                                "description": "Unique template identification number"
                            }
                        }
                    }
                }
            }
        },
        "responses": {
            "Accepted": {
                "description": "This class of status codes indicates the action requested by the client was received, understood, and accepted.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer",
                                    "description": "The status code.",
                                    "format": "int32"
                                },
                                "description": {
                                    "type": "string",
                                    "description": "The status description."
                                }
                            }
                        },
                        "examples": {
                            "Status-1004": {
                                "$ref": "#/components/examples/Status-1004"
                            }
                        }
                    }
                }
            },
            "AuthenticationError": {
                "description": "This class of status code is intended for situations in which the error seems to have been caused by the client.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer",
                                    "description": "The status code.",
                                    "format": "int32"
                                },
                                "description": {
                                    "type": "string",
                                    "description": "The status description."
                                }
                            }
                        },
                        "examples": {
                            "Status-1005": {
                                "$ref": "#/components/examples/Status-1005"
                            },
                            "Status-1008": {
                                "$ref": "#/components/examples/Status-1008"
                            },
                            "Status-1105": {
                                "$ref": "#/components/examples/Status-1105"
                            },
                            "Status-1106": {
                                "$ref": "#/components/examples/Status-1106"
                            },
                            "Status-1115": {
                                "$ref": "#/components/examples/Status-1115"
                            },
                            "Status-1116": {
                                "$ref": "#/components/examples/Status-1116"
                            },
                            "Status-1117": {
                                "$ref": "#/components/examples/Status-1117"
                            },
                            "Status-1120": {
                                "$ref": "#/components/examples/Status-1120"
                            },
                            "Status-1121": {
                                "$ref": "#/components/examples/Status-1121"
                            },
                            "Status-1122": {
                                "$ref": "#/components/examples/Status-1122"
                            }
                        }
                    }
                }
            },
            "Redirect": {
                "description": "This class of status code indicates the client must take additional action to complete the request. Many of these status codes are used in URL redirection."
            },
            "RetrieveMultiJsonDlrReferenceIdAccepted": {
                "description": "This class of status codes indicates the action requested by the client was received, understood, and accepted.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "XXX": {
                                    "type": "array",
                                    "description": "The DLR reference ID from user system.",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "channel": {
                                                "type": "string",
                                                "description": "DLR channels.",
                                                "enum": [
                                                    "sms",
                                                    "viber"
                                                ]
                                            },
                                            "id": {
                                                "type": "string",
                                                "description": "Unique identification number. It serves to receive a DLR."
                                            },
                                            "msisdn": {
                                                "type": "integer",
                                                "description": "Mobile Station International Subscriber Directory Number (Phone Number).",
                                                "format": "int32"
                                            },
                                            "code": {
                                                "type": "integer",
                                                "description": "DLR report code.",
                                                "format": "int32"
                                            },
                                            "description": {
                                                "type": "string",
                                                "description": "DLR report code description."
                                            },
                                            "date_submit": {
                                                "type": "string",
                                                "description": "Date and time the message was sent."
                                            },
                                            "date_report": {
                                                "type": "string",
                                                "description": "Date and time of receiving the status."
                                            },
                                            "reply": {
                                                "type": "array",
                                                "description": "Responses received via two-way communication.",
                                                "properties": {
                                                    "date": {
                                                        "type": "string",
                                                        "description": "Date and time the last message was received."
                                                    },
                                                    "messages": {
                                                        "type": "array",
                                                        "description": "Received messages."
                                                    }
                                                }
                                            },
                                            "udh": {
                                                "type": "string",
                                                "description": "User Data Header (UDH) only for SMS channel."
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "ServerError": {
                "description": "The server failed to fulfil a request."
            },
            "ServiceHlrError": {
                "description": "This class of status code is intended for situations in which the error seems to have been caused by the client.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer",
                                    "description": "The status code.",
                                    "format": "int32"
                                },
                                "description": {
                                    "type": "string",
                                    "description": "The status description."
                                }
                            }
                        },
                        "examples": {
                            "Status-1003": {
                                "$ref": "#/components/examples/Status-1003"
                            },
                            "Status-1005": {
                                "$ref": "#/components/examples/Status-1005"
                            },
                            "Status-1006": {
                                "$ref": "#/components/examples/Status-1006"
                            },
                            "Status-1007": {
                                "$ref": "#/components/examples/Status-1007"
                            },
                            "Status-1008": {
                                "$ref": "#/components/examples/Status-1008"
                            },
                            "Status-1020": {
                                "$ref": "#/components/examples/Status-1020"
                            },
                            "Status-1105": {
                                "$ref": "#/components/examples/Status-1105"
                            },
                            "Status-1106": {
                                "$ref": "#/components/examples/Status-1106"
                            },
                            "Status-1107": {
                                "$ref": "#/components/examples/Status-1107"
                            },
                            "Status-1113": {
                                "$ref": "#/components/examples/Status-1113"
                            },
                            "Status-1115": {
                                "$ref": "#/components/examples/Status-1115"
                            },
                            "Status-1116": {
                                "$ref": "#/components/examples/Status-1116"
                            },
                            "Status-1117": {
                                "$ref": "#/components/examples/Status-1117"
                            },
                            "Status-1118": {
                                "$ref": "#/components/examples/Status-1118"
                            },
                            "Status-1120": {
                                "$ref": "#/components/examples/Status-1120"
                            },
                            "Status-1121": {
                                "$ref": "#/components/examples/Status-1121"
                            },
                            "Status-1122": {
                                "$ref": "#/components/examples/Status-1122"
                            }
                        }
                    }
                }
            },
            "ServiceSmsError": {
                "description": "This class of status code is intended for situations in which the error seems to have been caused by the client.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer",
                                    "description": "The status code.",
                                    "format": "int32"
                                },
                                "description": {
                                    "type": "string",
                                    "description": "The status description."
                                }
                            }
                        },
                        "examples": {
                            "Status-1003": {
                                "$ref": "#/components/examples/Status-1003"
                            },
                            "Status-1005": {
                                "$ref": "#/components/examples/Status-1005"
                            },
                            "Status-1006": {
                                "$ref": "#/components/examples/Status-1006"
                            },
                            "Status-1007": {
                                "$ref": "#/components/examples/Status-1007"
                            },
                            "Status-1008": {
                                "$ref": "#/components/examples/Status-1008"
                            },
                            "Status-1015": {
                                "$ref": "#/components/examples/Status-1015"
                            },
                            "Status-1020": {
                                "$ref": "#/components/examples/Status-1020"
                            },
                            "Status-1105": {
                                "$ref": "#/components/examples/Status-1105"
                            },
                            "Status-1106": {
                                "$ref": "#/components/examples/Status-1106"
                            },
                            "Status-1113": {
                                "$ref": "#/components/examples/Status-1113"
                            },
                            "Status-1115": {
                                "$ref": "#/components/examples/Status-1115"
                            },
                            "Status-1116": {
                                "$ref": "#/components/examples/Status-1116"
                            },
                            "Status-1117": {
                                "$ref": "#/components/examples/Status-1117"
                            },
                            "Status-1118": {
                                "$ref": "#/components/examples/Status-1118"
                            },
                            "Status-1120": {
                                "$ref": "#/components/examples/Status-1120"
                            },
                            "Status-1121": {
                                "$ref": "#/components/examples/Status-1121"
                            },
                            "Status-1122": {
                                "$ref": "#/components/examples/Status-1122"
                            }
                        }
                    }
                }
            },
            "ServiceViberError": {
                "description": "This class of status code is intended for situations in which the error seems to have been caused by the client.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer",
                                    "description": "The status code.",
                                    "format": "int32"
                                },
                                "description": {
                                    "type": "string",
                                    "description": "The status description."
                                }
                            }
                        },
                        "examples": {
                            "Status-1003": {
                                "$ref": "#/components/examples/Status-1003"
                            },
                            "Status-1005": {
                                "$ref": "#/components/examples/Status-1005"
                            },
                            "Status-1006": {
                                "$ref": "#/components/examples/Status-1006"
                            },
                            "Status-1007": {
                                "$ref": "#/components/examples/Status-1007"
                            },
                            "Status-1008": {
                                "$ref": "#/components/examples/Status-1008"
                            },
                            "Status-1010": {
                                "$ref": "#/components/examples/Status-1010"
                            },
                            "Status-1011": {
                                "$ref": "#/components/examples/Status-1011"
                            },
                            "Status-1012": {
                                "$ref": "#/components/examples/Status-1012"
                            },
                            "Status-1013": {
                                "$ref": "#/components/examples/Status-1013"
                            },
                            "Status-1014": {
                                "$ref": "#/components/examples/Status-1014"
                            },
                            "Status-1015": {
                                "$ref": "#/components/examples/Status-1015"
                            },
                            "Status-1016": {
                                "$ref": "#/components/examples/Status-1016"
                            },
                            "Status-1017": {
                                "$ref": "#/components/examples/Status-1017"
                            },
                            "Status-1018": {
                                "$ref": "#/components/examples/Status-1018"
                            },
                            "Status-1019": {
                                "$ref": "#/components/examples/Status-1019"
                            },
                            "Status-1020": {
                                "$ref": "#/components/examples/Status-1020"
                            },
                            "Status-1021": {
                                "$ref": "#/components/examples/Status-1021"
                            },
                            "Status-1022": {
                                "$ref": "#/components/examples/Status-1022"
                            },
                            "Status-1105": {
                                "$ref": "#/components/examples/Status-1105"
                            },
                            "Status-1106": {
                                "$ref": "#/components/examples/Status-1106"
                            },
                            "Status-1113": {
                                "$ref": "#/components/examples/Status-1113"
                            },
                            "Status-1114": {
                                "$ref": "#/components/examples/Status-1114"
                            },
                            "Status-1115": {
                                "$ref": "#/components/examples/Status-1115"
                            },
                            "Status-1116": {
                                "$ref": "#/components/examples/Status-1116"
                            },
                            "Status-1117": {
                                "$ref": "#/components/examples/Status-1117"
                            },
                            "Status-1118": {
                                "$ref": "#/components/examples/Status-1118"
                            },
                            "Status-1119": {
                                "$ref": "#/components/examples/Status-1119"
                            },
                            "Status-1120": {
                                "$ref": "#/components/examples/Status-1120"
                            },
                            "Status-1121": {
                                "$ref": "#/components/examples/Status-1121"
                            },
                            "Status-1122": {
                                "$ref": "#/components/examples/Status-1122"
                            }
                        }
                    }
                }
            },
            "ServiceViberTemplateError": {
                "description": "This class of status code is intended for situations in which the error seems to have been caused by the client.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "integer",
                                    "description": "The status code.",
                                    "format": "int32"
                                },
                                "description": {
                                    "type": "string",
                                    "description": "The status description."
                                }
                            }
                        },
                        "examples": {
                            "Status-1003": {
                                "$ref": "#/components/examples/Status-1003"
                            },
                            "Status-1005": {
                                "$ref": "#/components/examples/Status-1005"
                            },
                            "Status-1006": {
                                "$ref": "#/components/examples/Status-1006"
                            },
                            "Status-1007": {
                                "$ref": "#/components/examples/Status-1007"
                            },
                            "Status-1008": {
                                "$ref": "#/components/examples/Status-1008"
                            },
                            "Status-1020": {
                                "$ref": "#/components/examples/Status-1020"
                            },
                            "Status-1105": {
                                "$ref": "#/components/examples/Status-1105"
                            },
                            "Status-1106": {
                                "$ref": "#/components/examples/Status-1106"
                            },
                            "Status-1107": {
                                "$ref": "#/components/examples/Status-1107"
                            },
                            "Status-1113": {
                                "$ref": "#/components/examples/Status-1113"
                            },
                            "Status-1115": {
                                "$ref": "#/components/examples/Status-1115"
                            },
                            "Status-1116": {
                                "$ref": "#/components/examples/Status-1116"
                            },
                            "Status-1117": {
                                "$ref": "#/components/examples/Status-1117"
                            },
                            "Status-1118": {
                                "$ref": "#/components/examples/Status-1118"
                            },
                            "Status-1120": {
                                "$ref": "#/components/examples/Status-1120"
                            },
                            "Status-1121": {
                                "$ref": "#/components/examples/Status-1121"
                            },
                            "Status-1122": {
                                "$ref": "#/components/examples/Status-1122"
                            },
                            "Status-1130": {
                                "$ref": "#/components/examples/Status-1130"
                            },
                            "Status-1131": {
                                "$ref": "#/components/examples/Status-1131"
                            }
                        }
                    }
                }
            },
            "CheckViberTemplateByIdAccepted": {
                "description": "This class of status codes indicates the action requested by the client was received, understood, and accepted.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "description": "The returned data.",
                            "properties": {
                                "code": {
                                    "type": "integer",
                                    "description": "Status code.",
                                    "format": "int32"
                                },
                                "description": {
                                    "type": "string",
                                    "description": "Status code description."
                                },
                                "data": {
                                    "type": "object",
                                    "description": "Response information.",
                                    "properties": {
                                        "id": {
                                            "type": "int",
                                            "description": "Template identifier."
                                        },
                                        "iso_639_1": {
                                            "type": "string",
                                            "description": "Two-letter ISO 639-1 language code (e.g., 'bg', 'en')."
                                        },
                                        "template": {
                                            "type": "string",
                                            "description": "Message template structure."
                                        },
                                        "status_id": {
                                            "type": "int",
                                            "description": "Template status identifier."
                                        },
                                        "status_description": {
                                            "type": "string",
                                            "description": "Template status description."
                                        },
                                        "status_approved_at": {
                                            "type": "string",
                                            "description": "Date and time when the template was approved."
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "description": "Date and time when the template was created."
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "examples": {
            "Status-1000": {
                "value": {
                    "code": 1000,
                    "description": "Delivered"
                }
            },
            "Status-1001": {
                "value": {
                    "code": 1001,
                    "description": "Seen message"
                }
            },
            "Status-1002": {
                "value": {
                    "code": 1002,
                    "description": "Transmitted"
                }
            },
            "Status-1003": {
                "value": {
                    "code": 1003,
                    "description": "Waiting for transmit"
                }
            },
            "Status-1004": {
                "value": {
                    "code": 1004,
                    "description": "Message accepted"
                }
            },
            "Status-1005": {
                "value": {
                    "code": 1005,
                    "description": "Rejected"
                }
            },
            "Status-1006": {
                "value": {
                    "code": 1006,
                    "description": "Invalid phone number"
                }
            },
            "Status-1007": {
                "value": {
                    "code": 1007,
                    "description": "Invalid schedule data"
                }
            },
            "Status-1008": {
                "value": {
                    "code": 1008,
                    "description": "Invalid json format"
                }
            },
            "Status-1010": {
                "value": {
                    "code": 1010,
                    "description": "Messenger text is empty"
                }
            },
            "Status-1011": {
                "value": {
                    "code": 1011,
                    "description": "Messenger text is out of range"
                }
            },
            "Status-1012": {
                "value": {
                    "code": 1012,
                    "description": "Image is not supported"
                }
            },
            "Status-1013": {
                "value": {
                    "code": 1013,
                    "description": "Button is not supported"
                }
            },
            "Status-1014": {
                "value": {
                    "code": 1014,
                    "description": "Button text length is large"
                }
            },
            "Status-1015": {
                "value": {
                    "code": 1015,
                    "description": "SMS text is out of range"
                }
            },
            "Status-1016": {
                "value": {
                    "code": 1016,
                    "description": "Invalid image source"
                }
            },
            "Status-1017": {
                "value": {
                    "code": 1017,
                    "description": "Button url is invalid"
                }
            },
            "Status-1018": {
                "value": {
                    "code": 1018,
                    "description": "Button is not supported"
                }
            },
            "Status-1019": {
                "value": {
                    "code": 1019,
                    "description": "Button without text is not supported"
                }
            },
            "Status-1020": {
                "value": {
                    "code": 1020,
                    "description": "SMS text is required"
                }
            },
            "Status-1021": {
                "value": {
                    "code": 1021,
                    "description": "Viber button caption is empty"
                }
            },
            "Status-1022": {
                "value": {
                    "code": 1022,
                    "description": "Incoming MSG"
                }
            },
            "Status-1105": {
                "value": {
                    "code": 1105,
                    "description": "User is not active"
                }
            },
            "Status-1106": {
                "value": {
                    "code": 1106,
                    "description": "Inactive user"
                }
            },
            "Status-1107": {
                "value": {
                    "code": 1107,
                    "description": "User don't have HLR permission"
                }
            },
            "Status-1113": {
                "value": {
                    "code": 1113,
                    "description": "Unknown operator"
                }
            },
            "Status-1114": {
                "value": {
                    "code": 1114,
                    "description": "Messenger destination and type (tr|pr)"
                }
            },
            "Status-1115": {
                "value": {
                    "code": 1115,
                    "description": "Invalid username or password"
                }
            },
            "Status-1116": {
                "value": {
                    "code": 1116,
                    "description": "Bad words"
                }
            },
            "Status-1117": {
                "value": {
                    "code": 1117,
                    "description": "No money"
                }
            },
            "Status-1118": {
                "value": {
                    "code": 1118,
                    "description": "Flood"
                }
            },
            "Status-1119": {
                "value": {
                    "code": 1119,
                    "description": "Messenger not allowed"
                }
            },
            "Status-1120": {
                "value": {
                    "code": 1120,
                    "description": "Empty required field"
                }
            },
            "Status-1121": {
                "value": {
                    "code": 1121,
                    "description": "Internet protocol not allowed"
                }
            },
            "Status-1122": {
                "value": {
                    "code": 1122,
                    "description": "Account is not active"
                }
            },
            "Status-1130": {
                "value": {
                    "code": 1130,
                    "description": "Unknown template"
                }
            },
            "Status-1131": {
                "value": {
                    "code": 1131,
                    "description": "Template is not approved"
                }
            },
            "Status-1201": {
                "value": {
                    "code": 1201,
                    "description": "Internal error occurred when trying to send message"
                }
            },
            "Status-1202": {
                "value": {
                    "code": 1202,
                    "description": "Ported"
                }
            },
            "Status-1203": {
                "value": {
                    "code": 1203,
                    "description": "Pending"
                }
            },
            "Status-1204": {
                "value": {
                    "code": 1204,
                    "description": "Expired"
                }
            },
            "Status-1205": {
                "value": {
                    "code": 1205,
                    "description": "Undelivered"
                }
            },
            "Status-1206": {
                "value": {
                    "code": 1206,
                    "description": "Unknown"
                }
            },
            "Status-1207": {
                "value": {
                    "code": 1207,
                    "description": "Phone is in seller blacklist"
                }
            },
            "Status-1208": {
                "value": {
                    "code": 1208,
                    "description": "Phone is in users blacklist"
                }
            },
            "Status-1209": {
                "value": {
                    "code": 1209,
                    "description": "Phone is in file blacklist"
                }
            },
            "Status-1210": {
                "value": {
                    "code": 1210,
                    "description": "Part of long message is undelivered"
                }
            },
            "Status-1259": {
                "value": {
                    "code": 1259,
                    "description": "Unknown seller"
                }
            }
        }
    }
}
