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 |
---|---|---|---|
frequency | object | Frequency refers to the configuration of how often an action or event should occur. It is a parameter that determines the repetition rate or schedule for a particular task or event. | No |
frequency.type | string | This property indicates the type of frequency. It can be one of three values: Fixed, Immediately, and Intelligent. | No |
frequency.repeat | string | Cron is a time-based job scheduling syntax used in Unix-based operating systems to specify recurring tasks. It determines how often the action or event should repeat. Eg. 0 0 * * *, where the cron value represents a schedule that runs a command or script at midnight (00:00) every day. https://crontab.guru/examples.html | No |
receiver | object | Configure the receiver(s) who will receive this notification. | No |
receiver.to | array | When sending an email, the sender specifies the recipient's email address in the To field, which identifies the intended recipient(s) of the email. | No |
receiver.to.email | string | Email address of the intended recipient(s). | Yes |
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. | No |
receiver.cc | array | List of the recipients who will receive a copy of your email. | No |
receiver.bcc | array | List of the recipients who will receive a blind carbon copy of your email. | No |
subject | string | The email may have a default subject line at the global or message level, but personalised subject lines can be set for specific recipients or segments of the email recipients, potentially providing a more tailored or customised subject line experience. | Yes |
subject.content | object | An array where you can specify the content of your email. | Yes |
subject.content.type | string | Supported email content types are: 1.text/plain, 2.text/html | Yes |
subject.content.value | string | Specify the actual content that will be displayed to the recipients of the email when they open and view the email message. | Yes |
attachment | object | Each attachment object can contain multiple key-value pairs that represent the properties or attributes of the attachment. You can include a maximum of 5 attachments up to 20 MB. | No |
attachment.content | string | The content is encoded base-64. | No |
attachment.filename | string | Name of the attachment value. | No |
attachment.type | string | The MIME type of content you are attaching supports the following formats: - disposition: Inline/attachment - pdf: application/pdf - html: text/html - JPEG image file: "image/jpeg" - PNG image file: "image/png" - GIF image file: "image/gif" - BMP image file: "image/bmp" - TIFF image file: "image/tiff" - MP3 audio file: "audio/mpeg" - WAV audio file: "audio/wav" - AAC audio file: "audio/aac" - Ogg Vorbis audio file: "audio/ogg" - zip : application/zip - Microsoft Word document file (docx): "application/vnd.openxmlformats-officedocument.wordprocessingml.document" - Microsoft Excel spreadsheet file (xlsx): "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - Microsoft PowerPoint presentation file (pptx): "application/vnd.openxmlformats-officedocument.presentationml.presentation"OpenDocument Text document file (odt): "application/vnd.oasis.opendocument.text" - PDF document file: "application/pdf" - Plain text document file: "text/plain" | |
attachment.disposition | string | The attachment disposition is specify how attached files should be handled in a message, with types including "inline" for displaying in the message and "attachment" for separate download. | No |
curl --location --request POST 'https://api.getnotifly.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": "html",
"value": ""
},
"attachments": [
]
}
curl --location --request POST 'https://api.getnotifly.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": "html",
"value": ""
},
"attachments": [
]
}
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
}
}
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 |
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 |