How To
Archived
How do I construct a curl command to successfully send external email via the REST API in OpenIDM 3.x?
The purpose of this article is to provide information on constructing a curl command to successfully send external email via the REST API in OpenIDM.
1 reader recommends this article
Archived
This article has been archived and is no longer maintained by ForgeRock.
Overview
You can send external email over REST if required, although you're more likely to use a script in production:
- For IDM 5.x and later, and OpenIDM 4.x, you should refer to the documentation for this process: Integrator's Guide › Sending Mail Over REST
- For OpenIDM 3.x, you should refer to the steps detailed below.
Sending external email
The basic format of the curl command for sending external email via the REST API is:
$ curl -H "Content-Type: application/json" -H "X-OpenIDM-Username: openidm-admin" -H "X-OpenIDM-Password: openidm-admin" -X POST -d '{"from":"sender@example.com", "to":"recipient@example.com", "subject":"Test Email", "body":"Test body text"}' "https://localhost:8080/openidm/external/email?_action=send"Note
Due to the use of the POST --data option (-d), spaces are permitted in the subject and body parameters without the need for url encoding.
See Also
Integrator's Guide › Sending Email
Related Training
N/A
Related Issue Tracker IDs
N/A