# Message Transactions

{% hint style="warning" %}
**Limited Support/End of Life Capabilities**

The Classic API has been replaced by the Alemba RestFul API.  While we will continue to support the Classic API for clients that are still using it, no further development will be done.

If you need to request a hotfix or support for these features, please contact [<mark style="color:blue;">**Alemba Support**</mark>](https://alemba.help/production/Portal.aspx)
{% endhint %}

Most email transactions also provide internal message and pager support.  The bEmail, bInternal and bPager options allow you to specify which message types you want to send.&#x20;

Recipients must have the correct permissions and settings to receive emails/internal messages and pagers.

For most messaging transactions, you can specify two parameters that the message template uses. The nMessageMapRef parameter is a reference to the HD\_MESSAGE\_MAP table.  This specifies the message template as well as the message type and query to use. The nMessageType parameter is a ASM message type number.  From this, the API will find the default template and query.

Similarly, the pager message type and map options will define the template to use.

For a list of message types used by the API, see Message Types.

### MessageSendMessage Transaction <a href="#messages" id="messages"></a>

The SendMessage transaction can be used to send messages to selected recipients from a selected email address. This transaction can only send the message.

#### Input Parameters: MessageRequest

<table data-header-hidden><thead><tr><th></th><th width="132"></th><th width="129"></th><th width="97"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Type</td><td>Mandatory</td><td>Default</td><td>Description</td></tr><tr><td>sID</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s current Session ID</td></tr><tr><td>sLoginUserID</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s Login ID</td></tr><tr><td>sLoginPassword</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s Password</td></tr><tr><td>sDatabase</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Name of the ASM System for logging in.</td></tr><tr><td>sFromEmailID</td><td>String</td><td>No</td><td>Sending analyst’s email address</td><td>From Email ID</td></tr><tr><td>lSentBy</td><td>Lookup Field</td><td>No</td><td>Analyst calling transaction</td><td>Analyst sending the message</td></tr><tr><td>eEntityType</td><td>Enumerated</td><td>Yes</td><td>-</td><td><p>Entity from which to send the email. Values:</p><ul><li>Call</li><li>Request</li><li>Task</li><li>Bulletin</li><li>Knowledge</li><li>CMDB item</li></ul></td></tr><tr><td>nEntityRef</td><td>Integer</td><td>Yes</td><td>-</td><td>Number of the entity (e.g. call, request, CMDB item) from which to send the email.</td></tr><tr><td>ePriority</td><td>Enumerated</td><td>No</td><td>No Priority</td><td><p>Priority associated with the email sent. Values:</p><ul><li>No Priority</li><li>Lowest</li><li>Low</li><li>Normal</li><li>High</li><li>Highest</li></ul></td></tr><tr><td>sSubject</td><td>String</td><td>No</td><td>“”</td><td>Subject line of the email sent</td></tr><tr><td>eMMAMessageType</td><td>Enumerated</td><td>No</td><td>None</td><td><p>MMA Message Type. Values:</p><ul><li>None</li><li>Call</li><li>Request</li><li>Task</li><li>Question</li><li>Approval</li><li>Placeholder (not relevant to the API)</li></ul></td></tr><tr><td>nMessageMapRef</td><td>Integer</td><td>No</td><td>None</td><td>Reference to the HD_MESSAGE_MAP table.  This specifies the message template as well as the message type and query to use.</td></tr><tr><td>nMessageType</td><td>Integer</td><td>No</td><td>None</td><td>ASM message type to use for this email.</td></tr><tr><td>eFormat</td><td>Enumerated</td><td>No</td><td>System default email out format</td><td><p>Email format. Values:</p><ul><li>Plain Text</li><li>HTML</li><li>Related HTML</li></ul></td></tr><tr><td>nPagerMapRef</td><td>Integer</td><td>No</td><td>None</td><td>Reference to the HD_PAGER_MAP table. This specifies the pager template as well as message type and query to use.</td></tr><tr><td>nPagerType</td><td>Integer</td><td>No</td><td>None</td><td>ASM pager type to use for this message.</td></tr><tr><td>lRecipientRef</td><td>Lookup Field</td><td>Yes</td><td>-</td><td>Recipient of the email</td></tr><tr><td>eRecipientType</td><td>Enumerated</td><td>Yes</td><td>-</td><td><p>Type of receipient to which to send the email. Values:</p><ul><li>IPK Group</li><li>Workflow Group</li><li>Person</li></ul></td></tr><tr><td>bEmail</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send an email to the intended recipient. Values:</p><ul><li>True = send email</li><li>False = do not send email</li></ul></td></tr><tr><td>bInternal</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send an internal message to the intended recipient. Values:</p><ul><li>True = send internal message</li><li>False = do not send internal message</li></ul></td></tr><tr><td>bPager</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send a pager message to the intended recipient. Values:</p><ul><li>True = send pager message</li><li>False = do not send pager message</li></ul></td></tr><tr><td>aCustomParameters</td><td>Array</td><td>No</td><td>“”</td><td>See Defining Custom Parameters.</td></tr></tbody></table>

#### Return Values:MessageResponse <a href="#messageresponse" id="messageresponse"></a>

| Argument | Type    | Description                                             |
| -------- | ------- | ------------------------------------------------------- |
| sMessage | String  | Error/Warning message returned from the API Transaction |
| nRet     | Integer | Error/warning number returned from the API Transaction  |

### MessageSendMessageByTemplate Transaction

#### Input Parameters: MessageByTemplateRequest

<table data-header-hidden><thead><tr><th></th><th width="124"></th><th width="131"></th><th width="95"></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Type</td><td>Mandatory</td><td>Default</td><td>Description</td></tr><tr><td>sID</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s current Session ID</td></tr><tr><td>sLoginUserID</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s Login ID</td></tr><tr><td>sLoginPassword</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s Password</td></tr><tr><td>sDatabase</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Name of the ASM System for logging in.</td></tr><tr><td>sTemplateName</td><td>String</td><td>Yes</td><td>-</td><td>Message template to use to send the message</td></tr><tr><td>sSubject</td><td>String</td><td>No</td><td>“”</td><td>Subject line of the email sent</td></tr><tr><td>ePriority</td><td>Enumerated</td><td>No</td><td>No Priority</td><td><p>Priority associated with the email sent. Values:</p><ul><li>No Priority</li><li>Lowest</li><li>Low</li><li>Normal</li><li>High</li><li>Highest</li></ul></td></tr><tr><td>lRecipientRef</td><td>Lookup Field</td><td>Yes</td><td>-</td><td>Recipient of the email</td></tr><tr><td>eRecipientType</td><td>Enumerated</td><td>Yes</td><td>-</td><td><p>Type of receipient to which to send the email. Values:</p><ul><li>IPK Group</li><li>Workflow Group</li><li>Person</li></ul></td></tr><tr><td>sEmailID</td><td>String</td><td>Yes</td><td>-</td><td>To Email ID</td></tr><tr><td>lSentBy</td><td>Lookup Field</td><td>No</td><td>Sending analyst’s email address</td><td>Analyst sending the message</td></tr><tr><td>sFromEmailID</td><td>String</td><td>No</td><td>Analyst calling transaction</td><td>From Email ID</td></tr><tr><td>nEntityRef</td><td>Integer</td><td>Yes</td><td>-</td><td>Number of the entity (e.g. call, request, CMDB item) from which to send the email.</td></tr><tr><td>eMMAMessageType</td><td>Enumerated</td><td>No</td><td>None</td><td><p>MMA Message Type. Values:</p><ul><li>None</li><li>Call</li><li>Request</li><li>Task</li><li>Question</li><li>Approval</li><li>Placeholder (not relevant to the API)</li></ul></td></tr><tr><td>bEmail</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send an email to the intended recipient. Values:</p><ul><li>True = send email</li><li>False = do not send email</li></ul></td></tr><tr><td>bInternal</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send an internal message to the intended recipient. Values:</p><ul><li>True = send internal message</li><li>False = do not send internal message</li></ul></td></tr><tr><td>bPager</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send a pager message to the intended recipient. Values:</p><ul><li>True = send pager message</li><li>False = do not send pager message</li></ul></td></tr><tr><td>aCustomParameters</td><td>Array</td><td>No</td><td>“”</td><td>See Defining Custom Parameters.</td></tr></tbody></table>

#### Return Values: MessageResponse

See MessageResponse for more information.

### MessageStakeHolders Transaction <a href="#messages2" id="messages2"></a>

#### Input Parameters: MessageStakeHoldersRequest

<table data-header-hidden><thead><tr><th></th><th width="149"></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Argument</td><td>Type</td><td>Mandatory</td><td>Default</td><td>Description</td></tr><tr><td>sID</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s current Session ID</td></tr><tr><td>sLoginUserID</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s Login ID</td></tr><tr><td>sLoginPassword</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Analyst’s Password</td></tr><tr><td>sDatabase</td><td>String</td><td>No. See Transaction Login.</td><td>“”</td><td>Name of the ASM System for logging in.</td></tr><tr><td>sFromEmailID</td><td>String</td><td>No</td><td>Sending analyst’s email address</td><td>From Email ID</td></tr><tr><td>lSentBy</td><td>Lookup Field</td><td>No</td><td>Analyst calling transaction</td><td>Analyst sending the message</td></tr><tr><td>eEntityType</td><td>Enumerated</td><td>Yes</td><td>-</td><td><p>Entity from which to send the email. Values:</p><ul><li>Call</li><li>Request</li><li>Task</li><li>Bulletin</li><li>Knowledge</li><li>CMDB item</li></ul></td></tr><tr><td>nEntityRef</td><td>Integer</td><td>Yes</td><td>-</td><td>Number of the entity (e.g. call, request, CMDB item) from which to send the email.</td></tr><tr><td>ePriority</td><td>Enumerated</td><td>No</td><td>No Priority</td><td><p>Priority associated with the email sent. Values:</p><ul><li>No Priority</li><li>Lowest</li><li>Low</li><li>Normal</li><li>High</li><li>Highest</li></ul></td></tr><tr><td>sSubject</td><td>String</td><td>No</td><td>“”</td><td>Subject line of the email sent</td></tr><tr><td>eMMAMessageType</td><td>Enumerated</td><td>No</td><td>None</td><td><p>MMA Message Type. Values:</p><ul><li>None</li><li>Call</li><li>Request</li><li>Task</li><li>Question</li><li>Approval</li><li>Placeholder (not relevant to the API)</li></ul></td></tr><tr><td>eRecipientTypes</td><td>Enumerated</td><td>Yes</td><td>-</td><td><p>Type of receipient to which to send the email. Values:</p><ul><li>IPK Group</li><li>Workflow Group</li><li>Person</li></ul></td></tr><tr><td>nMessageMapRef</td><td>Integer</td><td>No</td><td>None</td><td>ASM message type to use for this email.</td></tr><tr><td>nMessageType</td><td>Integer</td><td>No</td><td>System default email out format</td><td><p>Email format. Values:</p><ul><li>Plain Text</li><li>HTML</li><li>Related HTML</li></ul></td></tr><tr><td>eFormat</td><td>Enumerated</td><td>No</td><td>System default email out format</td><td><p>Email format. Values:</p><ul><li>Plain Text</li><li>HTML</li><li>Related HTML</li></ul></td></tr><tr><td>nPagerMapRef</td><td>Integer</td><td>No</td><td>None</td><td>Reference to the HD_PAGER_MAP table. This specifies the pager template as well as message type and query to use.</td></tr><tr><td>nPagerType</td><td>Integer</td><td>No</td><td>None</td><td>ASM pager type to use for this message.</td></tr><tr><td>bEmail</td><td>Boolean</td><td>No</td><td>False</td><td><p>Type of recipient to which to send the email. Values:</p><ul><li>IPK Group</li><li>Workflow Group</li><li>Person</li></ul></td></tr><tr><td>bInternal</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send an email to the intended recipient. Values:</p><ul><li>True = send email</li><li>False = do not send email</li></ul></td></tr><tr><td>bPager</td><td>Boolean</td><td>No</td><td>False</td><td><p>Indicate whether to send an internal message to the intended recipient. Values:</p><ul><li>True = send internal message</li><li>False = do not send internal message</li></ul></td></tr><tr><td>aCustomParameters</td><td>Array</td><td>No</td><td>False</td><td><p>Indicate whether to send a pager message to the intended recipient. Values:</p><ul><li>True = send pager message</li><li>False = do not send pager message</li></ul></td></tr></tbody></table>

#### Return Values: MessageResponse

See MessageResponse for more information.
