Send Email (v2)
This topic describes the simplified v2 version of this REST API. This version contains all parameters in the payload and does not require URL encoding while calling the REST APIs. This makes the v2 API easier to use. This API is backwards compatible.
REST Resource
POST /interop/rest/v2/mails/send
Table 9-109 Tasks
| Task | Request | REST Resource |
|---|---|---|
Trigger sendmail |
POST | /interop/rest/v2/mails/send |
Retrieve sendmail status
|
GET | /interop/rest/v2/status/jobs/777 |
Request
Supported Media Types: application/json
Table 9-110 Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
to |
The recipient email addresses separated by semi-colons | Payload | Yes | None |
subject |
The subject for the email | Payload | Yes | None |
body |
The body of the email providing details. | Payload | Yes | None |
|
|
Parameters for this REST API | Payload | No | None |
attachments |
One or more file names separated by commas to be added as
attachments to the email, for example,
outbox/Errorfile.txt or
inbox/Errorfile2.txtYou can attach any file up to 10 MB in size, other than a snapshot, that is available in Oracle Fusion Cloud Enterprise Performance Management environments. |
Payload | No | None |
Sample Request Payload
{
"subject": "SUBJECT_OF_THE_MAIL",
"to": "RECIPIENT_EMAIL_ADDRESS",
"body": "BODY_OF_THE_MAIL",
"parameters": {
"attachments": "NAME_OF_THE_FILE_TO_BE_ATTACHED"
}
}
Response
Table 9-111 Parameters
| Name | Description |
|---|---|
details |
In the case of errors, details are published with the error string |
status |
See Migration Status Codes |
links |
Detailed information about the link |
href |
Links to API call or status API |
action |
The HTTP call type |
rel |
Possible values: self or Job
Status. If the value is set to Job
Status, you can use the href to get the status
|
data |
Parameters as key value pairs passed in the request |
items |
Details about the resource |
links |
Details of the first URL to be requested to get the job details; rel is "Job Details" |
Example of Response Body
{
"status": -1,
"items": null,
"links": [{
"rel": "self",
"href": "https://<BASE-URL>/interop/rest/v2/mails/send",
"data": null,
"action": "POST"
}, {
"rel": "Job Status",
"href": "https://<BASE-URL>/interop/rest/v2/status/jobs/<JOB_ID>",
"data": null,
"action": "GET"
}],
"details": null
}
Sample cURL Command
curl -X POST -s -u '<USERNAME>:<PASSWORD>' -o response.txt -D respHeader.txt -H 'Content-Type: application/json' -d '{"subject":"SUBJECT_OF_THE_MAIL", "to":"RECIPIENT_EMAIL_ADDRESS","body":"BODY_OF_THE_MAIL","parameters":{"attachments":"NAME_OF_THE_FILE_TO_BE_ATTACHED"}}' 'https://<BASE URL>/interop/rest/v2/mails/send'