Comms API (1.0)
Consumer Health Platform - Comms API - Open API docs
/messages/send-email
Endpoint to send emails
Request Body schema: application/json
categories | Array of strings Default: [] Email category for reporting e.g ["transactional", "update"] |
object Default: {"userId":null,"orderId":null} | |
required | object Labels to tag the message with |
required | object (From) |
required | object (To) |
required | object (Template) |
Responses
Request samples
- Payload
Content type
application/json
{- "categories": [ ],
- "upstreamReferences": {
- "userId": null,
- "orderId": null
}, - "labels": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}, - "from": {
- "email": "string",
- "name": "string"
}, - "to": {
- "email": "string",
- "name": "string"
}, - "template": {
- "id": "string",
- "data": { }
}
}
Response samples
- 202
Content type
application/json
{- "id": "string"
}
/messages/send-sms
Endpoint to send sms
Request Body schema: application/json
from required | string The sending phone number |
to required | string The recipient phone number |
body required | string The content string that makes up the sms message |
required | object Labels to tag the message with |
categories | Array of strings Default: [] Sms category for reporting e.g ["transactional", "update"] |
object or null Default: {} | |
object or null |
Responses
Request samples
- Payload
Content type
application/json
{- "from": "string",
- "to": "string",
- "body": "string",
- "labels": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}, - "categories": [ ],
- "upstreamReferences": { },
- "question": {
- "expiresAt": "2019-08-24T14:15:22Z",
- "options": [
- {
- "label": "to cancel",
- "keyword": "CANCEL"
}
]
}
}
Response samples
- 202
Content type
application/json
{- "id": "string"
}
/messages
Endpoint to retrieve emails and sms
query Parameters
orderId | string |
userId | string |
emailAddress | string |
phoneNumber | string |
Responses
Response samples
- 200
Content type
application/json
{- "data": [
- {
- "id": "string",
- "transport": 0,
- "providerId": "string",
- "from": {
- "email": "string",
- "name": "string"
}, - "to": {
- "email": "string",
- "name": "string"
}, - "template": {
- "id": "string",
- "data": { }
}, - "categories": [
- "string"
], - "labels": {
- "vertical": "virtual_pharmacy",
- "primary": "account",
- "secondary": "string"
}, - "upstreamReferences": {
- "orderId": "string",
- "userId": "string"
}, - "originalId": "string",
- "deliveryStatus": "pending",
- "events": [
- {
- "id": "string",
- "providerId": "string",
- "kind": "delivery",
- "type": { },
- "timestamp": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "canResend": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "total": 0
}
/preferences
Endpoint to create communication preferences
Request Body schema: application/json
required | object (Labels) |
required | object (Labels) |
Responses
Request samples
- Payload
Content type
application/json
{- "sms": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}, - "email": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}
}
Response samples
- 201
- 202
Content type
application/json
{- "token": "string"
}
/preferences/{token}
Endpoint to update communication preferences
path Parameters
token required | string |
Request Body schema: application/json
required | object (Labels) |
required | object (Labels) |
Responses
Request samples
- Payload
Content type
application/json
{- "sms": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}, - "email": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}
}
Response samples
- 200
- 202
Content type
application/json
{- "token": "string"
}
/preferences/{token}
Endpoint to get communication preferences
path Parameters
token required | string |
Responses
Response samples
- 200
- 202
Content type
application/json
{- "sms": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}, - "email": {
- "secondary": "string",
- "vertical": "virtual_pharmacy",
- "primary": "account"
}, - "token": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}