Mobile Push
Easily noticeable and consumable, mobile-first experience.
Effortlessly send emails via Advantus APIs.
To access the Advantus email service, generate the token by authenticating API using client_id
and client_secret
from the Advantus web application. Then, the token needs to be provided in the header of the email API to send a successful notification.
To get started with Advantus email notifications, please consider the following points.:
client_id
and client_secret
within the Advantus application.The Method Type and API Endpoint are as follows:
POST: /api/notifications/email
The Header for email sending is:
{
"Authorization": "YOUR_TOKEN_HERE"
}
To send a request to the API, the following parameters must be included in the payload.
Item | Data Type | Description | Required |
---|---|---|---|
subject | string | Your email subject line. You can include dynamic variables like or . | Required unless using template_uuid |
receiver | object | Groups all your recipient email addresses (to, cc, bcc). | Required unless using segment_uuid |
receiver.to | string | List of primary recipient email addresses. Must include at least one valid email. | Required if using receiver |
receiver.to.{dynamic_fileds} | string | Personalised emails make the messages more relevant and engaging to the recipients. For example, sending an email to a customer with product recommendations based on their past purchase history, browsing behaviour, or wishlist items, and addressing the customer by name in the email. | Optional |
receiver.cc | string | List of CC recipient emails. Use empty array if no CC recipients. | Required if using receiver |
receiver.bcc | string | List of BCC recipient emails. Use empty array if no BCC recipients. | Required if using receiver |
segment_uuid | string | ID of a pre-saved recipient group. Use this instead of manually listing receivers. | Optional |
campaign_name | string | A friendly name for your email campaign (e.g., "December Newsletter", "Welcome Series"). | Optional |
content | object | Contains your email's content and format. | Required unless using template_uuid |
content.type | enum | Format of your email: "text/plain" for plain text, "text/html" for HTML emails. | Required with content |
content.value | string | Your actual email content. Supports dynamic variables like . | Required with content |
template_uuid | string | ID of a pre-saved email template. Use this instead of creating content from scratch. | Required unless providing subject and content |
reply_to | string | Email address where recipients can reply. This must be whitelisted to ensure all communications are received smoothly. | Optional |
attachments | object | List of files to attach to your email. | Optional |
attachments.type | array of object | File type (e.g., "application/pdf", "image/jpeg"). Supported Attachment Types PDF: application/pdf HTML: text/html Images: image/jpeg, image/png, image/gif, image/bmp, image/tiff Audio: audio/mpeg, audio/wav, audio/aac, audio/ogg Archives: application/zip Documents: DOCX: application/vnd.openxmlformats-officedocument.wordprocessingml.document XLSX: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet PPTX: application/vnd.openxmlformats-officedocument.presentationml.presentation ODT: application/vnd.oasis.opendocument.text TXT: text/plain | Required per attachment |
attachments.filename | string | Name of your file including extension (e.g., "report.pdf"). | Required per attachment |
attachment.content | string | The content is encoded base-64. | Optional |
attachments.disposition | string | How to display the file: "inline" (shown in email) or "attachment" (downloadable). | Required per attachment |
schedule | object | Main configuration object that contains all scheduling settings | Yes |
schedule.message_type | object | Contains settings about how often and when to send messages | Yes |
schedule.campaign_start_date | object | Contains settings about when to start the campaign | Yes |
schedule.sunset | object | Contains settings about when to end the campaign | Yes when message_type.type = 3 |
schedule.message_type.type | integer | Choose how often to send messages: 1 = send once 2 = send on specific dates 3 = send repeatedly | Yes |
schedule.message_type.date (for one-time sending) | integer | The exact date and time to send the message, in UTC timestamp format. Only used when type = 1 | Yes when type = 1 |
schedule.message_type.date (for multiple dates) | integer | List of dates and times to send the message, each in UTC timestamp format. Only used when type = 2 | Yes when type = 2 |
schedule.message_type.interval (for recurring1 messages) | integer | How many seconds to wait between each message send. Only used when type = 3. Cannot be used with days_of_week or days_of_month | Yes when type = 3 and not using days |
schedule.message_type.days_of_week (for recurring messages) | integer | Which day of the week to send (1-7). Only used when type = 3. Cannot be used with interval or days_of_month | Yes when type = 3 and not using interval or month |
schedule.message_type.days_of_month (for recurring messages) | integer | Which day of the month to send (1-31). Only used when type = 3. Cannot be used with interval or days_of_week | Yes when type = 3 and not using interval or week |
schedule.campaign_start_date.type2 | integer | Choose when to start the campaign: 1 = send immediately 2 = intelligent delivery (The notification will be sent based on user's timezone between 10am to 7pm and on the weekdays of Tuesday, Wednesday and Thursday.) 3 = time (After a fixed time is set, the next one can only be scheduled after 900 seconds.) Please refer to important notes below. | Yes |
schedule.campaign_start_date.send_immediately | boolean | Must be set to true if starting right away. Only used when type = 1 | Yes when type = 1 |
schedule.campaign_start_date.intelligent_delivery | boolean | Must be set to true if letting system choose time. Only used when type = 2 | Yes when type = 2 |
schedule.campaign_start_date.time | integer | The specific time to start (in seconds). Only used when type = 3 | Yes when type = 3 |
schedule.sunset.type (for recurring3 campaigns) | integer | Choose when to stop the campaign: 1 = Stop on specific date 2 = Never end campaign 3 = Stop after sending X times Only needed for recurring campaigns (message_type.type = 3) | Yes when using recurring messages |
schedule.sunset.date (for specific end date) | integer | The date to stop the campaign, in UTC timestamp format. Only used when sunset.type = 1 | Yes when sunset.type = 1 |
schedule.sunset.never_end_campaign (for endless campaigns) | boolean | Must be set to true for never-ending campaigns. Only used when sunset.type = 2 | Yes when sunset.type = 2 |
schedule.sunset.number_of_send (for limited sends) | integer | How many times to send before stopping. Must be a positive number. Only used when sunset.type = 3 | Yes when sunset.type = 3 |
Important Notes:
curl --location --request POST 'https://api.advantus.io/api/notifications/email' \
--header 'Authorization: YOUR_TOKEN_HERE\
--header 'Content-Type: application/json' \
--data-raw '{
"receiver": {
"to": [
{
"email": "RECEIPIENT'S_EMAIL_ADDRESS",
"name": "RECEIPIENT'S_NAME"
}
],
"cc": [
"List_Of_Recipients_Who_will_Receive_Copy_Of_Your_Email"
],
"bcc": [
"List_Of_Recipients_Who_will_Receive_Carbon_Copy_Of_Your_Email"
]
},
"subject": "SUBJECT_OF_YOUR_EMAIL",
"content": {
"type": "text/plain or text/html",
"value": "content of email"
},
"attachments": [
{
"content": "base64 encode",
"filename": "index.html",
"type": "text/html",
"disposition": "attachment"
}
],
"reply_to": null,
"campaign_name": "campaign name",
"schedule": {
"message_type": {
"type": 1,
"date": 1735516800
},
"campaign_start_date": {
"type": 1,
"send_immediately": true
},
"sunset": {
"type": 1,
"date": 1735516800
}
}
}
curl --location --request POST 'https://api.advantus.io/api/notifications/email' \
--header 'Authorization: YOUR_TOKEN_HERE\
--header 'Content-Type: application/json' \
--data-raw '{
"receiver": {
"to": [
{
"email": "RECEIPIENT'S_EMAIL_ADDRESS",
"name": "RECEIPIENT'S_NAME"
}
],
"cc": [
"List_Of_Recipients_Who_will_Receive_Copy_Of_Your_Email"
],
"bcc": [
"List_Of_Recipients_Who_will_Receive_Carbon_Copy_Of_Your_Email"
]
},
"subject": "SUBJECT_OF_YOUR_EMAIL",
"content": {
"type": "text/plain or text/html",
"value": "content of email"
},
"attachments": [
{
"content": "base64 encode",
"filename": "index.html",
"type": "text/html",
"disposition": "attachment"
}
],
"reply_to": null,
"campaign_name": "campaign name",
"schedule": {
"message_type": {
"type": 1,
"date": 1735516800,
},
"campaign_start_date": {
"type": 1,
"send_immediately": true,
},
"sunset": {
"type": 1,
"date": 1735516800,
}
}
}
There are multiple ways to use email scheduling platform.
{
"schedule": {
"message_type": {
"type": 1,
"date": 1735516800,
"type":2,
"date": [1735516800,1735516800],
"type":3,
"days_of_week": [],
"days_of_month": [],
"months_of_year": [],
"interval":3600
}
}
}
{
"schedule": {
"campaign_start_date": {
"type":1,
"send_immediately":true,
"type": 2,
"intelligent_delivery":"true",
"type": 3,
"time": 72000
}
}
}
{
"schedule": {
"sunset":{
"type":1,
"date":1735516800,
"type":2,
"never_end_camgaign":false,
"type":3,
"number_of_send":3
}
}
}
When making a request, replace value
with your token. If the request is successful, you will get a JSON response containing the access token.
If the API receives a successful request, it will typically return specific parameters as part of the response:
{
"success": true,
"message": "Your notification has been queued for delivery.",
"data": {
"notification_id": 4753 OR "schedule_id": "5c1f2266-b4fc-4bfe-84ef-819e552cc6da"
}
}
Parameter | Type | Description | Mandatory |
---|---|---|---|
success | boolean | Indicating whether the request was successful or not. | Yes |
message | boolean /string | Informs of additional value if sent along with the response, which can be either false or a string that defines the action done by the API caller. | Yes |
data | object | A JSON object containing information related to the request | Yes |
data.notification_id | integer | A notification id generated after making an API call. | Yes |
data.schedule_id | string | Only received at the time of email scehduling | Optional |
If the email request fails, the API will return specific parameters (HTTP errors) as part of the response:
Error Code | HTTP Status | Cause | Solution |
---|---|---|---|
1000 | 401 | Invalid token | Provide correct token in API request |
1003 | 400 | Missing data | Provide the mandatory data in API request |
1298 | 400 | Missing/invalid configuration details | To configure, choose an email service provider and provide the necessary details in the API request |
1357 | 400 | Invalid reply-to email address | Provide a valid email address in the reply-to field |
1359 | 400 | Invalid schedule message type | Specify a valid message schedule type |
1360 | 400 | Invalid scheduled message date | Provide a valid date for scheduled messages |
1361 | 400 | Invalid scheduled advanced settings | Check and correct the advanced scheduling settings |
1362 | 400 | Invalid timezone setting for scheduled delivery | Ensure correct timezone is specified for scheduled delivery |
1363 | 400 | Invalid campaign start date | Provide a valid start date for the campaign |
1364 | 400 | Missing schedule parameters | Provide either 'interval' or at least one of: 'days_of_week', 'days_of_month', or 'months_of_year' |
1365 | 400 | Invalid schedule time | Specify a valid time for scheduling |
1366 | 400 | Invalid days of week | Provide valid days of the week values |
1367 | 400 | Invalid days of month | Provide valid days of the month values |
1368 | 400 | Invalid months of year | Provide valid months of the year values |
1369 | 400 | Invalid date selection for immediate campaign | Cannot select future date when campaign is set to start immediately |
1374 | 400 | Past date selected | Select a future date where required |
1375 | 400 | Invalid sunset date | Provide a valid sunset date |
1376 | 400 | Invalid sunset type | Specify a valid sunset type |
1377 | 400 | Invalid never-end campaign setting | Provide valid settings for never-ending campaigns |
1378 | 400 | Missing recipient information | Provide either 'segment_uuid' or 'receiver' |
1379 | 400 | Conflicting recipient information | Provide either 'segment_uuid' or 'receiver', not both |
1380 | 400 | Missing subject | Provide 'subject' when 'template_uuid' is not specified |
1381 | 400 | Missing content | Provide 'content' when 'template_uuid' is not specified |
1382 | 400 | Missing content | Provide 'content' when 'template_uuid' is not specified |
1383 | 400 | Missing content type | Include 'type' in the content object |
1384 | 400 | Invalid meta fields | Provide valid meta_fields |
1385 | 400 | Unsupported content type | Use a supported content type |
1386 | 400 | Invalid attachments | Provide valid attachments |
1387 | 400 | Invalid schedule payload | Ensure schedule payload is properly formatted |
1388 | 400 | Invalid receiver format | Ensure receiver is provided as a dictionary |
1389 | 400 | Invalid 'to' field format | Ensure 'to' field is provided as a list |
1390 | 400 | Invalid recipient format | Ensure each recipient in 'to' is a dictionary |
1391 | 400 | Invalid email in recipients | Provide valid email addresses in 'to' field |
1392 | 400 | Invalid list format | Ensure the field is provided as a list |
1393 | 400 | Invalid email format | Provide valid email address |
1394 | 400 | Duplicate emails | Remove duplicate email addresses |
1395 | 400 | Duplicate template name | Choose a unique template name |
1396 | 400 | Invalid end date | Ensure end date is after Tuesday |