Adapter - SaySimple
This page describes version 2.0.6 of the adapter.
Overview
This page describes the usage of the SaySimple adapter. This adapter can be used to receive/send messages from/to the Social Media Provider SaySimple. The adapter requires the NEC Social Media Proxy Service to communicate with SaySimple. The service must be installed separate from UIP. Adapter and service support 3 types of social media messages: WhatsApp, Twitter Direct Messages and Facebook Messenger.
Adapter Configuration
Before the adapter can be used, first it needs some configuration-data. To locate the Social Media Proxy Service, the hostname or IP-address and port-number must be configured. To send messages to SaySimple, the public endpoint address of SaySimple must be configured. To send messages to WhatsApp, Twitter or Messenger you need a SaySimple account per media type and the account must be configured in the adapter.
These settings must be configured using the next parameters:
Properties
Name | Display | Is Required | Comments | Type | Default Value | Maximum Value | Minimum Value | Maximum Length | Minimum Length |
---|---|---|---|---|---|---|---|---|---|
publicEndpoint | SaySimple public endpoint | True | The public endpoint of the SaySimple service. | string | https://api.eazy.im/2.0/message/ | 1024 | |||
proxyUri | Social Media Proxy Service Hostname or IP Address | True | Hostname or IP-address of the Social Media Proxy Service. | string | 1024 | ||||
proxyPort | Port Number of the Social Media Proxy Service | True | IP port-number of the Social Media Proxy Service. | integer | 32050 | 5 | |||
idKeyPair1 | Account Id,Key pair 1 | False | Id and Key pair (comma-separated) of a social media account, provided by SaySimple. | string | 256 | ||||
idKeyPair2 | Account Id,Key pair 2 | False | Id and Key pair (comma-separated) of a social media account, provided by SaySimple. | string | 256 | ||||
idKeyPair3 | Account Id,Key pair 3 | False | Id and Key pair (comma-separated) of a social media account, provided by SaySimple. | string | 256 | ||||
idKeyPair4 | Account Id,Key pair 4 | False | Id and Key pair (comma-separated) of a social media account, provided by SaySimple. | string | 256 | ||||
idKeyPair5 | Account Id,Key pair 5 | False | Id and Key pair (comma-separated) of a social media account, provided by SaySimple. | string | 256 |
Commands
Send a message (SendMessage)
Sends a social-media message to the specified address (JabberId).
Request Properties
Name | Display | Description | Is Required | Type |
---|---|---|---|---|
sourceAddress | Address of the sender | Unique address (JabberId) of the message-sender. | True | string |
destinationAddress | Address to send to | Unique address (JabberId) of the message-recipient. | True | string |
message | Message | The message (text) to be sent to the recipient. | True | string |
Response Properties
Name | Description | Type |
---|---|---|
isSuccess | True when the message is sent successfully. | boolean |
Events
Incoming Message (IncomingMessage)
A social-media message has been received.
Event Properties
Name | Display | Description | Type |
---|---|---|---|
sourceAddress | Address of the sender | Unique address (JabberId) of the sender of the message. | string |
sourceName | Name of the sender | Name of the sender of the message. | string |
sourcePhoneNumber | Phonenumber of the sender | The telephone-number of the sender of the message. | string |
sourcePicture | Picture of the sender | Picture of the sender of the message. | string |
destinationAddress | Destination address | Unique address (JabberId) of the destination of the message. | string |
message | Message | The contents of the received message. | string |
messageType | Message type | The type of the received message: Text, Attachment, Url, Location. | string |
mediaType | Media type | The type of media received in the message: WhatsApp, Messenger (Facebook), Twitter. | string |
attachments | Attachments | A list of attachment(s) included in this message. | array |
attachments.Url | Attachment Url | The Url of the attachment. Can be used with the 'Get Attachment' command to retrieve it's content. | string |
attachments.FileName | Attachment filename | The filename of the attachment. | string |
attachments.MimeType | Attachment mime-type | The mime-type of the attachment. | string |
attachments.Size | Attachment size | The size (in bytes) of the attachment. | string |
attachments.Duration | Attachment duration | The duration (in seconds) when playing the attachment (only valid for certain mime-types). | string |
longitude | Longitude of the location | The longitude (in decimal degrees) of a location received in a Location message. | string |
latitude | Latitude of the location | The latitude (in decimal degrees) of a location received in a Location message. | string |
url | Url | The Url received for a Location- or Url-message. | string |
urlTitle | Url title | The title of the Url received for a Url-message. | string |
urlSubtitle | Url subtitle | The subtitle of the url received for a Url-message. | string |
urlDescription | Url description | The description of the Url received for a Url-message. | string |
Connection Status (ConnectionStatus)
This event signals the connection-status from the adapter towards the social-media provider.
Event Properties
Name | Display | Description | Type |
---|---|---|---|
status | Status | Status of the connection to the social-media provider (value true implies it is connected). | boolean |
endpoint | Endpoint of Social Media provider | Endpoint of the Social Media provider for which the status changes. | string |
Fetching attachments
In case an "IncomingMessage" is received with messageType "Attachment", the URL of the attachment can be obtained using "attachments.Url". With this URL the attachment itself can be retrieved using the Http Request Adapter:
- Within a workflow, add a command-step for the Http Request Adapter, select the "Get" command.
- Enter the received attachment-URL as URI parameter.
- From the received response, use '{header.Content-Length}' to retrieve the size of the attachment,
- use '{header.Content-Type}' to retrieve the mime-type (e.g. image/jpg) of the attachment and
- use '{content}' to retrieve the attachment data itself.
Release History
Version | Type | Description | Tracking # | Date |
---|---|---|---|---|
2.0.1 | Initial | First release in the Adapter Type store. | ||
2.0.5 | Maintenance | Updated third-party components and improved maintainability. | NAP-11518 | |
2.0.6 | Maintenance | Updated third-party components and improved maintainability. | NAP-23945 | 2022-11-30 |