Emails
Use these methods to manage email delivery services, such as SendGrid, connected to the Back Office, as well as send mass emails to your clients.
GET[host]/api/v2/mail/subscriptions/providers |
|
GET[host]/api/v2/mail/subscriptions/providers/{providerId} |
|
POST[host]/api/v2/mail/subscriptions/providers |
|
PATCH[host]/api/v2/mail/subscriptions/providers/{providerId} |
|
DELETE[host]/api/v2/mail/subscriptions/providers/{providerId} |
GET[host]/api/v2/mail/subscriptions/templates |
|
GET[host]/api/v2/mail/subscriptions/templates/{templateId} |
|
POST[host]/api/v2/mail/subscriptions/templates |
|
PATCH[host]/api/v2/mail/subscriptions/templates/{templateId} |
|
DELETE[host]/api/v2/mail/subscriptions/templates/{templateId} |
GET[host]/api/v2/mail/subscriptions/messages |
|
GET[host]/api/v2/mail/subscriptions/messages/{messageId} |
|
POST[host]/api/v2/mail/subscriptions/messages |
|
DELETE[host]/api/v2/mail/subscriptions/messages/{messageId} |
Get a list of email delivery services
Use this method to obtain a list of email delivery services connected to the Back Office.
To obtain detailed information about a specific email delivery service, use a separate method to get email delivery service details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- caption
The email delivery service name used in the Back Office.
- platform
The email delivery service name, such as SendGrid.
- isEnabled
If
1
, the email delivery service connection is enabled; otherwise,0
.
The following sorting parameters are available for this method:
- createTime
The date and time when the email delivery service was configured in the Back Office.
- caption
The email delivery service name used in the Back Office.
Refer to the Query parameters section of the Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/mail/subscriptions/providers
curl --location -g 'https://host.name/api/v2/mail/subscriptions/providers?limit=10&offset=0&sort_order=desc&filter[caption]=Name&filter[platform]=SendGrid&filter[isEnabled]=1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an array of Email Delivery Service objects providing information about the email delivery services matching the request parameters.
Get email delivery service details
Use this method to obtain detailed information about a specific email delivery service connected to the Back Office.
To obtain a full list of email delivery services, use a separate method to get a list of email delivery services.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- providerId required
The identifier of the email delivery service.
GET[host]/api/v2/mail/subscriptions/providers/{providerId}
curl --location 'https://host.name/api/v2/mail/subscriptions/providers/1' \
--header 'Authorization: Bearer <token>'
Response
A response includes an Email Delivery Service object providing information about the specified email delivery service.
Add an email delivery service
Use this method to add a new email delivery service.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters when adding an email delivery service:
- platform string required
The email delivery service name, such as SendGrid.
- caption string required
The email delivery service name used in the Back Office.
POST[host]/api/v2/mail/subscriptions/providers
curl --location --request POST 'https://host.name/api/v2/mail/subscriptions/providers' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"platform": "SendGrid",
"caption": "SendGrid config"
}'
Response
A response includes an Email Delivery Service object providing information about the added email delivery service.
Update an email delivery service configuration
Use this method to update a specified email delivery service configuration.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- providerId required
The identifier of the email delivery service.
Body:
The following field values can be updated:
- isEnabled integer
If
1
, the email delivery service connection is enabled; otherwise,0
.- caption string
The email delivery service name used in the Back Office.
- options object
The connection settings of the email delivery service.
PATCH[host]/api/v2/mail/subscriptions/providers/{providerId}
curl --location --request PATCH 'https://host.name/api/v2/mail/subscriptions/providers/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"isEnabled": 0,
"caption": "SendGrid config",
"options": {
"sender_address": "user@example.com",
"sender_name": "The company name",
"api_key": "lA1bXX8O0UM01Tgt-w7cjxfxFu-qQfXm7ccnN5j8wG8"
}
}'
Response
A response includes an Email Delivery Service object providing information about the updated configuration.
Delete an email delivery service configuration
Use this method to remove a specified email delivery service configuration.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- providerId required
The identifier of the email delivery service.
DELETE[host]/api/v2/mail/subscriptions/providers/{providerId}
curl --location --request DELETE 'https://host.name/api/v2/mail/subscriptions/providers/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of email templates
Use this method to obtain a list of email templates created in the Back Office.
To obtain detailed information about a specific template, use a separate method to get email template details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- caption
The email template name used in the Back Office.
- description
The email template description.
- subject
The email subject.
- providerId
The identifier of the email delivery service connected to the Back Office.
The following sorting parameter is available for this method:
- createTime
The date and time when the email template was created.
Refer to the Query parameters section of the Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/mail/subscriptions/templates
curl --location --request GET 'https://host.name/api/v2/mail/subscriptions/templates?limit=10&offset=0&sort_order=desc&filter[caption]=Name&filter[subject]=Subject&filter[description]=Description&filter[providerId]=1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an array of Email Template objects providing information about the templates matching the request parameters.
Get email template details
Use this method to obtain detailed information about a specific email template.
To obtain a full list of templates, use a separate method to get a list of email templates.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- templateId required
The email template identifier.
GET[host]/api/v2/mail/subscriptions/templates/{templateId}
curl --location --request GET 'https://host.name/api/v2/mail/subscriptions/templates/1' \
--header 'Authorization: Bearer <token>'
Response
A response includes an Email Template object providing information about the specified template.
Create an email template
Use this method to create a new email template.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters for a template:
- subject string required
The email subject.
- caption string required
The email template name used in the Back Office.
- description string required
The email template description.
- providerId integer required
The identifier of the email delivery service connected to the Back Office.
- template string required
The content of the email template, in the HTML format.
POST[host]/api/v2/mail/subscriptions/templates
curl --location --request POST 'https://host.name/api/v2/mail/subscriptions/templates' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"subject": "The email subject",
"caption": "The email template caption",
"description": "The email template description",
"providerId": 1,
"template": "The email template content"
}'
Response
A response includes an Email Template object providing information about the created template.
Update an email template
Use this method to update a specific email template.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- templateId required
The email template identifier.
Body:
The following field values can be updated for a specified template:
- subject string
The email subject.
- caption string
The email template name used in the Back Office.
- description string
The email template description.
- providerId integer
The identifier of the email delivery service that is used to deliver emails.
- template string
The content of the email template, in the HTML format.
PATCH[host]/api/v2/mail/subscriptions/templates/{templateId}
curl --location --request PATCH 'https://host.name/api/v2/mail/subscriptions/templates/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"subject": "The email subject",
"caption": "The email template caption",
"description": "The email template description",
"providerId": 1,
"template": "<b>The email template content</b>"
}'
Response
A response includes an Email Template object providing information about the updated template.
Delete an email template
Use this method to remove a specified email template.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- templateId required
The email template identifier.
DELETE[host]/api/v2/mail/subscriptions/templates/{templateId}
curl --location --request DELETE 'https://host.name/api/v2/mail/subscriptions/templates/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of sent emails
Use this method to obtain a list of emails that were sent to clients.
To obtain detailed information about a specific email, use a separate method to get sent email details.
Request
Header parameters:
Authorization: Bearer <token>
GET[host]/api/v2/mail/subscriptions/messages
curl --location --request GET 'https://host.name/api/v2/mail/subscriptions/messages?limit=10&offset=0' \
--header 'accept-language: <string>' \
--header 'Authorization: Bearer <token>'
Response
A response includes an array of Sent Email objects providing information about the emails matching the request parameters.
Get sent email details
Use this method to obtain detailed information about a specific email that was sent to clients.
To obtain a full list of sent emails, use a separate method to get a list of sent emails.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- messageId required
The identifier of the sent email.
GET[host]/api/v2/mail/subscriptions/messages/{messageId}
curl --location --request GET 'https://host.name/api/v2/mail/subscriptions/messages/1' \
--header 'Authorization: Bearer <token>'
Response
A response includes a Sent Email object providing information about the specified email.
Send an email
Use this method to send mass emails to clients using an email delivery service connected to the Back Office.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters when sending an email:
- providerId integer
The identifier of the email delivery service connected to the Back Office.
- sendAt string
The date and time when the email needs to be sent out.
- subject string
The email subject.
- description string
The internal description of the email.
- allClients integer
If
1
, the email is to be sent to all clients; otherwise,0
.- addressesCsv string
The name of a CSV file that includes a list of client email addresses to which the email is to be sent.
- addresses array
An array of string values specifying the client email addresses to which the email is to be sent.
- bccCsv string
The name of a CSV file that includes a list of email addresses to which email blind copies are to be sent.
- bcc array
An array of string values specifying the email addresses to which email blind copies are to be sent.
- ccCsv string
The name of a CSV file that includes a list of email addresses to which email carbon copies are to be sent.
- cc array
An array of string values specifying the email addresses to which email carbon copies are to be sent.
- content string
The email content, in the HTML format.
- attachments array
An array of string values specifying the names of the files that you want to attach to the email.
POST[host]/api/v2/mail/subscriptions/messages
curl --location --request POST 'https://host.name/api/v2/mail/subscriptions/messages' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"providerId": 1,
"sendAt": "2022-01-01T00:00:00+00:00",
"subject": "The email subject",
"description": "The email description",
"allClients": 0,
"addressesCsv": "filename.csv",
"addresses": [
"client1@example.com",
"client2@example.com"
],
"bcc": [
"user1@example.com",
"user2@example.com"
],
"bccCsv": "filename.csv",
"cc": [
"user3@example.com",
"user4@example.com"
],
"ccCsv": "filename.csv",
"content": "The email content",
"attachments": [
"filename.png",
"filename.pdf"
]
}'
Response
In case of success, no response body is returned.
Delete a sent email
Use this method to remove a specified email from the list of sent emails.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- messageId required
The identifier of the sent email.
DELETE[host]/api/v2/mail/subscriptions/messages/{messageId}
curl --location --request DELETE 'https://host.name/api/v2/mail/subscriptions/messages/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.