notification-service (0.1.0)

Download OpenAPI specification:Download

Service provides a wrapper to Sendgrid that can be used to send emails from all our services. Service exposes only one internal endpoint that expects SendGrid Dynamic Template ID, receiver email address, and email payload.

CreateEmailTemplate

Creates a new email template and stores it in the database.

Request Body schema: application/json
type
required
string
active
required
boolean
templateId
required
string
allowedSendFrequencySeconds
required
number <double>
provider
required
string (EmailProvider)
Enum: "sendgrid" "smtp2go"

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "active": true,
  • "templateId": "string",
  • "allowedSendFrequencySeconds": 0.1,
  • "provider": "sendgrid"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1,
  • "details": { }
}

GetEmailTemplates

Gets a paginated list of email templates.

query Parameters
top
number <double>
Default: 10

The number of search results to return on that page

skip
number <double>
Default: 0

The number of search results skipped

Responses

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "records": [
    ]
}

GetEmailTemplateByType

Gets an email template by message type.

path Parameters
type
required
string

The email template type

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "type": "string",
  • "active": true,
  • "templateId": "string",
  • "allowedSendFrequencySeconds": 0.1,
  • "provider": "sendgrid",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

UpdateEmailTemplate

Update an email template by email type.

path Parameters
type
required
string

The email template type

Request Body schema: application/json

Email template fields which need be updated

type
string
active
boolean
templateId
string
allowedSendFrequencySeconds
number <double>

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "active": true,
  • "templateId": "string",
  • "allowedSendFrequencySeconds": 0.1
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1,
  • "details": { }
}

SendEmail

Send an email by template type, email address and payload

Request Body schema: application/json

The payload contains the templateType, email address and payload of the email.

Array of objects (AttachmentJSON)

attachments to be included with email

payload
required
object

Payload of the email

recipientsVisible
required
boolean

Should recipients see each other's addresses

to
required
Array of strings [ 1 .. 10 ] items

Receiver email address

templateType
required
string (EmailTemplateType)
Enum: "BEAUTYOS_OTP_CODE" "BEAUTYOS_RECEIPT" "BEAUTYOS_SALON_INVITATION" "BEAUTYOS_PAYMENT_HISTORY" "BEAUTYOS_APPOINTMENT_REMINDER_24H" "BEAUTYOS_APPOINTMENT_CONFIRMATION" "BEAUTYOS_APPOINTMENT_UPDATE" "BEAUTYOS_APPOINTMENT_CANCELLATION_BY_ARTIST" "BEAUTYOS_PAYMENT_LINK"

Responses

Request samples

Content type
application/json
{
  • "attachments": [
    ],
  • "payload": {
    },
  • "recipientsVisible": true,
  • "to": [
    ],
  • "templateType": "BEAUTYOS_OTP_CODE"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1,
  • "details": { }
}

CreateSmsTemplate

Creates a new SMS template and stores it in the database.

Request Body schema: application/json
type
required
string (SmsMessageType)
Enum: "BEAUTYOS_OTP_CODE" "BEAUTYOS_SALON_INVITATION" "BEAUTYOS_PAYMENT_LINK" "BEAUTYOS_APPOINTMENT_REMINDER_24H" "BEAUTYOS_APPOINTMENT_REMINDER_48H" "BEAUTYOS_APPOINTMENT_CONFIRMATION" "BEAUTYOS_APPOINTMENT_UPDATE"
active
required
boolean
template
required
string
allowedSendFrequencySeconds
required
number <double>

Responses

Request samples

Content type
application/json
{
  • "type": "BEAUTYOS_OTP_CODE",
  • "active": true,
  • "template": "string",
  • "allowedSendFrequencySeconds": 0.1
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1,
  • "details": { }
}

GetSmsTemplates

Gets a paginated list of SMS templates.

query Parameters
top
number <double>
Default: 10

The number of search results to return on that page

skip
number <double>
Default: 0

The number of search results skipped

Responses

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "records": [
    ]
}

GetSmsTemplateByType

Gets an SMS template by message type.

path Parameters
type
required
string (SmsMessageType)
Enum: "BEAUTYOS_OTP_CODE" "BEAUTYOS_SALON_INVITATION" "BEAUTYOS_PAYMENT_LINK" "BEAUTYOS_APPOINTMENT_REMINDER_24H" "BEAUTYOS_APPOINTMENT_REMINDER_48H" "BEAUTYOS_APPOINTMENT_CONFIRMATION" "BEAUTYOS_APPOINTMENT_UPDATE"

The SMS template type

Responses

Response samples

Content type
application/json
{
  • "type": "BEAUTYOS_OTP_CODE",
  • "active": true,
  • "template": "string",
  • "allowedSendFrequencySeconds": 0.1,
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

UpdateSmsTemplate

Update an SMS template by message type.

path Parameters
type
required
string (SmsMessageType)
Enum: "BEAUTYOS_OTP_CODE" "BEAUTYOS_SALON_INVITATION" "BEAUTYOS_PAYMENT_LINK" "BEAUTYOS_APPOINTMENT_REMINDER_24H" "BEAUTYOS_APPOINTMENT_REMINDER_48H" "BEAUTYOS_APPOINTMENT_CONFIRMATION" "BEAUTYOS_APPOINTMENT_UPDATE"

The SMS template type

Request Body schema: application/json

SMS template fields which need be updated

type
string (SmsMessageType)
Enum: "BEAUTYOS_OTP_CODE" "BEAUTYOS_SALON_INVITATION" "BEAUTYOS_PAYMENT_LINK" "BEAUTYOS_APPOINTMENT_REMINDER_24H" "BEAUTYOS_APPOINTMENT_REMINDER_48H" "BEAUTYOS_APPOINTMENT_CONFIRMATION" "BEAUTYOS_APPOINTMENT_UPDATE"
active
boolean
template
string
allowedSendFrequencySeconds
number <double>

Responses

Request samples

Content type
application/json
{
  • "type": "BEAUTYOS_OTP_CODE",
  • "active": true,
  • "template": "string",
  • "allowedSendFrequencySeconds": 0.1
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1,
  • "details": { }
}

InitiateTwilioUpdateStatusCallback

Initiates the Twilio callback to update the status of the SMS message.

header Parameters
x-twilio-signature
required
string
Request Body schema: application/json
SmsStatus
required
string (MessageStatus)
Enum: "accepted" "queued" "sending" "sent" "failed" "delivered" "undelivered" "receiving" "received" "read" "partially_delivered" "canceled"
SmsSid
string
MessagingServiceSid
string
ErrorCode
string
MessageStatus
required
string (MessageStatus)
Enum: "accepted" "queued" "sending" "sent" "failed" "delivered" "undelivered" "receiving" "received" "read" "partially_delivered" "canceled"
MessageSid
required
string
ReferralNumMedia
string
NumMedia
string
Body
string
To
string
From
string
AccountSid
string
ApiVersion
string

Responses

Request samples

Content type
application/json
{
  • "SmsStatus": "accepted",
  • "SmsSid": "string",
  • "MessagingServiceSid": "string",
  • "ErrorCode": "string",
  • "MessageStatus": "accepted",
  • "MessageSid": "string",
  • "ReferralNumMedia": "string",
  • "NumMedia": "string",
  • "Body": "string",
  • "To": "string",
  • "From": "string",
  • "AccountSid": "string",
  • "ApiVersion": "string"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1,
  • "details": { }
}

InitiateSendSMS

Sends an SMS message to the given number and stores the message metadata in the database.

Request Body schema: application/json
messageType
required
string (SmsMessageType)
Enum: "BEAUTYOS_OTP_CODE" "BEAUTYOS_SALON_INVITATION" "BEAUTYOS_PAYMENT_LINK" "BEAUTYOS_APPOINTMENT_REMINDER_24H" "BEAUTYOS_APPOINTMENT_REMINDER_48H" "BEAUTYOS_APPOINTMENT_CONFIRMATION" "BEAUTYOS_APPOINTMENT_UPDATE"
toNumber
required
string
payload
object

Responses

Request samples

Content type
application/json
{
  • "messageType": "BEAUTYOS_OTP_CODE",
  • "toNumber": "string",
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1
}

Notifications

GetUnseenCount

Authorizations:
jwt
query Parameters
salonId
required
string
header Parameters
user-id
required
string

Responses

Response samples

Content type
application/json
{
  • "count": 0.1
}

GetById

Authorizations:
jwt
path Parameters
id
required
string
header Parameters
user-id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "message": "string",
  • "channels": [
    ],
  • "to": "string",
  • "userId": "string",
  • "salonId": "string",
  • "payload": {
    },
  • "status": "pending",
  • "type": "owner_new_appointment",
  • "isSeen": true,
  • "sentAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

List

Authorizations:
jwt
query Parameters
salonId
required
string
skip
number <double>
Default: 0
top
number <double>
Default: 10
header Parameters
user-id
required
string

Responses

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "records": [
    ]
}

MarkAllAsSeen

Authorizations:
jwt
query Parameters
salonId
required
string
header Parameters
user-id
required
string

Responses

Response samples

Content type
application/json
"string"

SendPushNotification

Request Body schema: application/json
title
required
string
message
required
string
to
required
string
salonId
required
string
userId
required
string
channel
required
string (NotificationChannel)
Enum: "email" "sms" "push"
payload
object (NotificationPayloadMap)
type
required
string (NotificationType)
Enum: "owner_new_appointment" "owner_appointment_cancelled" "owner_appointment_rescheduled" "stylist_new_appointment" "stylist_appointment_cancelled" "stylist_appointment_rescheduled" "salon_invitation" "owner_payment_link_completed" "stylist_payment_link_completed" "owner_appointment_updated" "stylist_appointment_updated"
notificationId
string

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "message": "string",
  • "to": "string",
  • "salonId": "string",
  • "userId": "string",
  • "channel": "email",
  • "payload": {
    },
  • "type": "owner_new_appointment",
  • "notificationId": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "success": true
}

GetById

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "message": "string",
  • "channels": [
    ],
  • "to": "string",
  • "userId": "string",
  • "salonId": "string",
  • "payload": {
    },
  • "status": "pending",
  • "type": "owner_new_appointment",
  • "isSeen": true,
  • "sentAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update

path Parameters
id
required
string
Request Body schema: application/json
title
string
message
string
channels
Array of strings (NotificationChannel)
Items Enum: "email" "sms" "push"
to
string
userId
string
salonId
string
payload
object (NotificationPayloadMap)
status
string (NotificationStatus)
Enum: "pending" "sent" "delivered"
type
string (NotificationType)
Enum: "owner_new_appointment" "owner_appointment_cancelled" "owner_appointment_rescheduled" "stylist_new_appointment" "stylist_appointment_cancelled" "stylist_appointment_rescheduled" "salon_invitation" "owner_payment_link_completed" "stylist_payment_link_completed" "owner_appointment_updated" "stylist_appointment_updated"
isRead
boolean
isSeen
boolean
sentAt
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "message": "string",
  • "channels": [
    ],
  • "to": "string",
  • "userId": "string",
  • "salonId": "string",
  • "payload": {
    },
  • "status": "pending",
  • "type": "owner_new_appointment",
  • "isRead": true,
  • "isSeen": true,
  • "sentAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "message": "string",
  • "channels": [
    ],
  • "to": "string",
  • "userId": "string",
  • "salonId": "string",
  • "payload": {
    },
  • "status": "pending",
  • "type": "owner_new_appointment",
  • "isRead": true,
  • "isSeen": true,
  • "sentAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Remove

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1
}

List

query Parameters
salonId
required
string
userId
required
string
skip
number <double>
Default: 0
top
number <double>
Default: 10

Responses

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "records": [
    ]
}

CreateAndSend

Request Body schema: application/json
channels
required
Array of strings (NotificationChannel)
Items Enum: "email" "sms" "push"
to
required
string
userId
required
string
salonId
required
string
payload
object (NotificationPayloadMap)
status
string (NotificationStatus)
Enum: "pending" "sent" "delivered"
type
required
string (NotificationType)
Enum: "owner_new_appointment" "owner_appointment_cancelled" "owner_appointment_rescheduled" "stylist_new_appointment" "stylist_appointment_cancelled" "stylist_appointment_rescheduled" "salon_invitation" "owner_payment_link_completed" "stylist_payment_link_completed" "owner_appointment_updated" "stylist_appointment_updated"
isRead
boolean
isSeen
boolean
sentAt
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "channels": [
    ],
  • "to": "string",
  • "userId": "string",
  • "salonId": "string",
  • "payload": {
    },
  • "status": "pending",
  • "type": "owner_new_appointment",
  • "isRead": true,
  • "isSeen": true,
  • "sentAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "title": "string",
  • "message": "string",
  • "channels": [
    ],
  • "to": "string",
  • "userId": "string",
  • "salonId": "string",
  • "payload": {
    },
  • "status": "pending",
  • "type": "owner_new_appointment",
  • "isRead": true,
  • "isSeen": true,
  • "sentAt": "2019-08-24T14:15:22Z",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

SendPushNotification

Request Body schema: application/json
title
required
string
message
required
string
to
required
string
salonId
required
string
userId
required
string
channel
required
string (NotificationChannel)
Enum: "email" "sms" "push"
payload
object (NotificationPayloadMap)
type
required
string (NotificationType)
Enum: "owner_new_appointment" "owner_appointment_cancelled" "owner_appointment_rescheduled" "stylist_new_appointment" "stylist_appointment_cancelled" "stylist_appointment_rescheduled" "salon_invitation" "owner_payment_link_completed" "stylist_payment_link_completed" "owner_appointment_updated" "stylist_appointment_updated"
notificationId
string

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "message": "string",
  • "to": "string",
  • "salonId": "string",
  • "userId": "string",
  • "channel": "email",
  • "payload": {
    },
  • "type": "owner_new_appointment",
  • "notificationId": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "success": true
}

Phone Number

CreatePhoneNumber

Creates a phone number that has been purchased in Twilio.

Request Body schema: application/json
phoneNumber
required
string
createdBy
required
string

Responses

Request samples

Content type
application/json
{
  • "phoneNumber": "string",
  • "createdBy": "string"
}

Response samples

Content type
application/json
{
  • "phoneNumber": "string",
  • "createdBy": "string",
  • "updatedBy": "string",
  • "active": true
}

GetPhoneNumbers

Retrieves all phone numbers that have been purchased in Twilio.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

UpdatePhoneNumber

Updates a phone number that has been purchased in Twilio.

path Parameters
phoneNumber
required
string
Request Body schema: application/json
phoneNumber
string
active
boolean
updatedBy
required
string

Responses

Request samples

Content type
application/json
{
  • "phoneNumber": "string",
  • "active": true,
  • "updatedBy": "string"
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "message": "string",
  • "code": "string",
  • "status": 0.1,
  • "details": { }
}

GetPhoneNumber

Retrieves a phone number that has been purchased by id.

path Parameters
phoneNumber
required
string

Responses

Response samples

Content type
application/json
{
  • "phoneNumber": "string",
  • "createdBy": "string",
  • "updatedBy": "string",
  • "active": true
}