Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 2.18 KB

HttpProtocolV1.md

File metadata and controls

69 lines (47 loc) · 2.18 KB

HTTP REST Protocol (version 1)
Sms Delivery Microservice

Sms delivery microservice implements a REST compatible API, that can be accessed on configured port. All input and output data is serialized in JSON format. Errors are returned in standard format.

Data types

SmsMessageV1 class

Message object with sender and recipient addresses, subject and content

Properties: - to: string or [string] - one or several addresses of message recipient - from: string - (optional) sender address - text: string - (optional) message plain text body

SmsRecipientV1 class

Recipient properties. If some properties are not set, the service tries to restore them from sms settings.

Properties:

  • id: string - unique user id
  • name: string - (optional) user full name
  • phone: string - (optional) primary user sms
  • language: string - (optional) user preferred language

Operations

Method: 'POST', route '/sms_delivery/send_message'

Sends sms message to specified address or addresses

Arguments:

  • message: SmsMessageV1 - message to be sent
  • parameters: Object - (optional) template parameters

Response body: error or null for success

Method: 'POST', route '/sms_delivery/send_message_to_recipient'

Sends sms message to specified recipient

Request body:

  • recipient: SmsRecipientV1 - recipient properties, including id
  • message: SmsMessageV1 - message to be sent
  • parameters: Object - (optional) template parameters

Response body: error or null for success

Method: 'POST', route '/sms_delivery/send_message_to_recipients'

Sends sms message to multiple recipients

Request body:

  • recipients: SmsRecipientV1[] - array of recipient properties, including id
  • message: SmsMessageV1 - message to be sent
  • parameters: Object - (optional) template parameters

Response body: error or null for success