Skip to content

Commit

Permalink
[#124] changes notification endpoint to take in both notification types
Browse files Browse the repository at this point in the history
Co-authored-by: Saman Moshafi <saman.moshafi@thoughtworks.com>
  • Loading branch information
marisahoenig and saman-moshafi-va committed Jul 31, 2020
1 parent c2e3120 commit ca091e1
Showing 1 changed file with 16 additions and 52 deletions.
68 changes: 16 additions & 52 deletions documents/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,33 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Template'
/v2/notifications/sms:
/v2/notifications/{notification_type}:
post:
summary: Send a notification
tags:
- notification
summary: Send an SMS notification.
parameters:
- in: path
name: 'notification_type'
schema:
type: string
enum:
- sms
- email
required: true
allowEmptyValue: false
description: Type of notification
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/SMSNotificationRequestWithPhoneNumber'
- $ref: '#/components/schemas/SMSNotificationRequest'
- $ref: '#/components/schemas/EmailNotificationRequest'
responses:
'200':
description: Details of queued SMS notification.
description: Details of queued notification.
content:
application/json:
schema:
Expand All @@ -261,44 +273,6 @@ paths:
- from_number
required:
- content
/v2/notifications/email:
post:
tags:
- notification
summary: Send an email notification.
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/EmailNotificationRequestWithEmailAddress'
responses:
'200':
description: Details of queued email notification.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/NotificationResponse'
- type: object
properties:
content:
type: object
properties:
from_email:
type: string
format: email_address
body:
type: string
subject:
type: string
required:
- body
- from_email
- subject
required:
- content
components:
schemas:
ErrorMessage:
Expand Down Expand Up @@ -747,11 +721,6 @@ components:
sms_sender_id:
type: string
format: uuid
SMSNotificationRequestWithPhoneNumber:
allOf:
- $ref: '#/components/schemas/SMSNotificationRequest'
- type: object
properties:
phone_number:
type: string
format: phone_number
Expand All @@ -765,11 +734,6 @@ components:
email_reply_to_id:
type: string
format: uuid
EmailNotificationRequestWithEmailAddress:
allOf:
- $ref: '#/components/schemas/EmailNotificationRequest'
- type: object
properties:
email_address:
type: string
format: email_address
Expand Down

0 comments on commit ca091e1

Please sign in to comment.