--> --> --> -->

HSM Request (imOutHSM)

The method described in this article is only intended for SME.

HSM Templates (HSM stands for Highly Structured Messages) are proactive messages that you can send to your clients. As a result of executing the request, a message containing JSON will be sent from the server. The client will be able to continue the conversation within 24 hours after the last message from the client.

Request Endpoint

Make a POST request to this URL: https://im.edna.io/api/imOutHSM

Request Format

A JSON object with message parameters is passed in the request body. The set of parameters depends on the type of HSM message and its content: text, images, documents, audio or video.

Request Parameters

ParameterTypeDescription
idstringMessage ID. Should be generated by external system and and transmitted to the request
subjectstringText of message subject. Important! All signatures must first be registered on the platform. Otherwise the message will not be delivered
addressstringNumber in 79ХХХХХХХХХ format. The message will be sent to this number
imTypestring (optional)You shoud point a whatsapp for HSM
contentTypestringType of message content. For HSM you shoud point a text
textstringThe text of the message template in accordance with the approved HSM
headerobject (optional)Header of message. You can choose one of the following header options: text, image, document. For the text header, you need to specify the text. The header can contain the one variable {{1}}. The title itself is displayed in bold before the message. For the multimedia header, specify a link to the document or a link image
footerobject (optional)Footer is a signature. Displayed under the message in a muted text color
buttonsobject (optional)An array of objects in each of which a button is defined. Types of buttons:
Text
Link
Phone
Payload – returns an incoming message

Examples of Messages

  •  Text:
{
    "id": "test-001",
    "subject": "test",
    "address": "7900000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Emma. Thank you for shoping at Best2Shop!"
}
  • Text and a header:
{
    "id": "test-001",
    "subject": "test",
    "address": "7900000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Emma. Thank you for shoping at Best2Shop! Your e-receipt is attached",
    "header": {
        "documentUrl": "https://e-receipt-example.best2shop.com/1231id"
        "documentName": "sample_name.pdf"
    }
}
  • Text and a signature (footer):
{
    "id": "test-001",
    "subject": "test",
    "address": "7900000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Emma. Thank you for shoping at Best2Shop!"
"footer": {
        "text": "Yours sincerely, Best2Shop"
    }
}
  • Text, a header, and a signature (footer):
{
    "id": "test-001",
    "subject": "test",
    "address": "7900000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Emma. Thank you for shoping at Best2Shop! Your e-receipt is attached",
    "header": {
        "documentUrl": "https://e-receipt-example.best2shop.com/1231id"
        "documentName": "sample_name.pdf"
    },
    "footer": {
        "text": "Yours sincerely, Best2Shop"
    }
}
  • Text and a chat button:
{
    "id": "test-001",
    "subject": "test",
    "address": "7900000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Emma. Thank you for shoping at Best2Shop! Would you like to receive delivery notification so you can track your order?",
    "keyboard": {
        "row": {
            "buttons": [
                {
                    "text": "Yes",
                    "buttonType": "QUICK_REPLY",
                    "payload": "Your_code"
                },
                {
                    "text": "No",
                    "buttonType": "QUICK_REPLY",
                    "payload": "Your_code"
                }
            ]
        }
    }
}
  • Text and a URL-button:
{
    "id": "test-001",
    "subject": "test",
    "address": "7900000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Emma. Thank you for shoping at Best2Shop! Don't forget our website ",
    "keyboard": {
        "row": {
            "buttons": [
                {
                    "text": "Visit Web",
                    "buttonType": "URL",
                    "url": "https://best2shop.com"
                }
            ]
        }
    }
}
  • Text and a call button:
{
    "id": "test-001",
    "subject": "test",
    "address": "7900000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Emma. Thank you for shoping at Best2Shop! If you have any further questions please call us",
    "keyboard": {
        "row": {
            "buttons": [
                {
                    "text": "Contact Us",
                    "buttonType": "PHONE",
                    "phone": "7900000000"
                }
            ]
        }
    }
}
  • A combination of text, header, call-button, and url-button:
{
    "id": "test-001",
    "subject": "TEST",
    "address": "+79000000000",
    "imType": "whatsapp",
    "contentType": "text",
    "text": "Hi Daniel,\n Your current account is 781 EUR. In case you find any irregularities, please report to our support team",
    "header": {
        "imageUrl": "https://Best2Shop.com/logo"
    },
    "footer": {
        "text": "Yours sincerely, Best2Shop"
    }
    "keyboard": {
        "row": {
            "buttons": [
                {
                    "text": "Contact Us",
                    "buttonType": "PHONE",
                    "phone": "7900000000"
                },
                {
                    "text": "Visit Web",
                    "buttonType": "URL",
                    "url": "https://best2shop.com"
                }
            ]
        }
    }
}

Response Format

Response body contains a JSON with message delivery status and details.

{
  "id": "test-001",
  "code": "ok"
}

Response Parameters

ParameterTypeDescription
idstringMessage identifier. It is generated by your system
codestringResponse code for this message. See the possible values in the Available status codes article.