Skip to content

sendEmailAlert ​

Sends an email alert for a given alertType. Currently only 'Forum' is supported for alertType but could be extended later to Chat or whatever we need.

Request ​

http
POST /rest/user/notification/emailAlert

Headers ​

HeaderRequiredDescription
x-nextinteract-authtokenYesAuth token returned from loginUser

Parameters ​

ParameterTypeRequiredDescription
versionNumberYesVersion of this API. Currently version 1.
alertTypeStringYesThe type of email alert this relates to. Currently only 'Forum' is supported but this could be 'Chat' or whatever in the future.
companyIdNumberYesThe id of the company this relates to. NOTE: this assumes that Forums, Chats etc relate to a SAM Company (which usually they will). This however may break if/when we permit user-to-user chat for instance but we can review then.
keyIdStringYesThe id relating to the alertType. For Forum the keyId is the assetId.
emailTitleStringYesThe title (subject) of the email to be sent.
emailDescriptionStringYesThe description (body) of the email to be sent.
emailLinkStringYesWould fill the button in the generic email template.
emailTemplateStringYesFUTURE USE. Original intention was to pass thru a client-specific email template.
emailLogoURLStringYesA URL of the logo image to be injected into the generic template.

SAMPLE REQUEST

json
{
  "version": 1,
  "alertType": "Forum",
  "companyId": 3,
  "keyId": "123", //asset id for Forums
  "emailTemplate": "NOT USED YET!",
  "emailLogoURL": "https://s3-ap-southeast-2.amazonaws.com/interact-technology-sydney/SAM/logo.png",
  "emailTitle": "Email Subject goes here",
  "emailDescription": "TEST OF testSendEmailAlert_OK",
  "emailLink": "http://deeplink.or.url.com?whatever=whatevs"
}

Response ​

200 OK ​

SAMPLE RESPONSE

json
{
  "numberValue": 1
}

Where numberValue is the number of emails sent.

Errors ​

ExceptionDescription
WSInvalidParameterExceptionSee Error Definitions
WSUnsupportedVersionExceptionSee Error Definitions
WSInvalidAuthTokenExceptionSee Error Definitions
WSCacheServiceExceptionSee Error Definitions
WSInsufficientPrivilegesExceptionSee Error Definitions
WSRecordNotFoundExceptionSee Error Definitions
WSAuthorisationServiceExceptionSee Error Definitions
WSEmailServiceExceptionSee Error Definitions
WSUserPreferenceServiceExceptionSee Error Definitions
WSNotificationServiceExceptionSee Error Definitions