I'm using Marketing Cloud Rest API and I have already created emails. How can I send one email to just one receiver via the API? Is it possible? I read the documentation about messageDefinitionSends and can't find a method for this action.
1 Answer
The documentation article you posted is the correct one for the desired task. You need to create a triggered send definition before you can use this call however. This can be done using Email Studio for example.
1. Creating a triggered email in Email Studio roughly works like this:
- Go to Email Studio -> Interactions -> Messages -> Email -> Triggered Sends -> Create
- Create Triggered Send
- Complete Properties-form (here you select your external key you need for the request)
- Select the created email to send
- Complete Subscribers management-form
- Set send options
- Save
Additional and detailed information on the various options can be found in the Create a Triggered Email Message Interaction documentation article.
2. Send a POST-request to the API
Use [restendpoint]/messaging/v1/messageDefinitionSends/key:[external key of your triggered send]/send
using your instance's endpoint and the external key of your triggered send definition defined earlier.
The body of your request could look like this:
{
"From": {
"Address": "[email protected]",
"Name": "Your Company"
},
"To": {
"Address": "[email protected]",
"SubscriberKey": "SUBSCRIBERS_KEY"
},
"OPTIONS": {
"RequestType": "SYNC"
}
}