Outgoing API specification
You can see the example request bodies that the messaging service can execute when you configure it to use custom API integrations.
SMS REST integration
If you choose the custom API integration option for your SMS gateway, the messaging service forwards the actual message to the specified endpoint by doing an HTTP POST request.
The following is an example request body that will be sent:
{
"from": "+987654321",
"to": "+123456789",
"renderedTextBody": "Hello from service John!",
"contentParameters": {
"name": "John",
"lastName": "Doe"
},
"messageId": "5f02a5c0-ed54-4e09-a41e-620e1296d3ad",
"userId": "dc36b80e-08d3-40c6-8b1d-db5b2ae4aa4e"
}
Email REST integration
If you choose the custom API integration option for your email gateway, the messaging service forwards the actual email to the specified endpoint by doing an HTTP POST request.
The following is an example request body that is sent:
{
"fromAddress": "service@onewelcome.com",
"toAddress": "john.doe@example.org",
"ccAddresses": [
"john.doe+1@example.org",
"joes.friend@example.org"
],
"bccAddresses": [
"joes.boss@example.org"
],
"replyToAddress": "support@onewelcome.com",
"subject": "Example email from service",
"html": "<html><h1>Html email content</h1></html>",
"text": "Plain text email content",
"contentParameters": {
"name": "John",
"lastName": "Doe"
},
"messageId": "5f02a5c0-ed54-4e09-a41e-620e1296d3ad",
"userId": "dc36b80e-08d3-40c6-8b1d-db5b2ae4aa4e"
}
Timeouts
When interacting with external APIs, the OneWelcome Identity Platform has implemented a maximum timeout of five seconds for the requests. This timeout is designed to protect the service by ensuring that it remains responsive and reliable. Enforcing this limit minimizes the risk of prolonged delays or failures caused by slow or unresponsive API endpoints.
Implementing timeouts on external calls is a recommended practice for any application, because it helps safeguard against performance issues or unavailability of the API. Proactively setting a timeout maintains the service's overall stability and responsiveness, enhancing the user experience for your customers.