Unified Messaging
The API is divided into three main sections: Mail Routes , Message Routes and FCM Notification Route, which are accessed, respectively. Additionally, there is a general health check route at /ping
.
Base URL
- Main URL endpoint :
https://67b15f5096c72e7ada3a.functions.itsoch.com
- Base path
/api2/mail
,/api2/message
and/api2/notification
Authorization
- Requires
Cookie
:JSESSIONID=session_id
or Basic Auth
Important
- Only ADMIN can access these endpoints using JSESSIONID authentication or with Basic Auth
Ping
GET /ping
Description: Provides a simple health check endpoint to verify that the server is running.
Example Request:
curl -X GET "https://67b15f5096c72e7ada3a.functions.itsoch.com/ping" \
-H "Cookie: JSESSIONID=your_session_id"
Responses:
200 OK - Response Body
{
"message": "pong"
}
Send SMS
POST /api2/message/send
Description: Sends a message to the specified recipient.
Example Request:
curl -X POST "https://67b15f5096c72e7ada3a.functions.itsoch.com/api2/message/send" \
-H "Cookie: JSESSIONID=your_session_id" \
-H "Content-Type: application/json" \
-d '{
"to": "recipient_number",
"message": "Hello, this is a test message!"
}'
Request Body:
Parameter | Type | Required | Description |
---|---|---|---|
to |
string | Yes | The recipient of the message. |
message |
string | Yes | The content of the message. |
Responses:
200 OK - Response Body
{
"success": true,
"message": "Message sent successfully!",
"data": {
/* response data */
}
}
400 Bad Request - (Missing Parameters)
{
"message": "To and Message are required!"
}
Send Mail
POST /api2/mail/send
Description: Sends an email to the specified recipient.
Example Request:
curl -X POST "https://67b15f5096c72e7ada3a.functions.itsoch.com/api2/mail/send" \
-H "Cookie: JSESSIONID=your_session_id" \
-H "Content-Type: application/json" \
-d '{
"to": "recipient@example.com",
"mailType": "WELCOME",
"subject": "Welcome to our service"
}'
Request Body:
Parameter | Type | Required | Description |
---|---|---|---|
to |
string | Yes | The recipient's email address. |
mailType |
string | Yes | The type of email to be sent. |
subject |
string | Yes | The subject of the email. |
Responses:
200 OK - Response Body
{
"success": true,
"message": "Mail sent successfully!",
"data": {
/* response data */
}
}
400 Bad Request - (Missing Parameters)
{
"message": "to, mailType and subject are required!"
}
Send FCM Notification
POST /api2/notification/send
Description: Sends push notifications to multiple devices using Firebase Cloud Messaging (FCM).
Example Request:
curl -X POST "https://67b15f5096c72e7ada3a.functions.itsoch.com/api2/notification/send" \
-H "Cookie: JSESSIONID=your_session_id" \
-H "Content-Type: application/json" \
-d '{
"receivers": ["device_token_1", "device_token_2"],
"title": "Notification Title",
"body": "Notification Message",
"priority": "normal"
}'
Request Body:
Parameter | Type | Required | Description |
---|---|---|---|
receivers |
string[] | Yes | Array of FCM device tokens to receive notification |
title |
string | Yes | The title of the notification |
body |
string | Yes | The message content of the notification |
priority |
string | No | Priority of notification (default: "normal") |
Responses:
200 OK - Response Body
[
"projects/project-id/messages/message-id-1",
"projects/project-id/messages/message-id-2"
]
400 Bad Request - (Missing Parameters)
{
"message": "Missing required fields: receivers, title, body"
}