Email API
Send Email to Group
POST /interact/groups/{groupID}/email
Send an email to all participants in a group. Keep in mind only participants that have the relevant email preference enabled will receive this email.
Currently supported email types are checkinReminder
, which reminds a participant to complete a check-in, and privacyRequest
, which requests a privacy preference review.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
groupID
(required): The group ID of the group you want to email.
Body
{ "emailType": "checkinReminder" | "privacyRequest" }
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/interact/groups/1710748366424/email",
{
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
},
body: JSON.stringify({
emailType: "Email Type",
}),
}
).then((response) => response.json());
import requests
requests.post("https://api.okaya.me/interact/groups/1710748366424/email",
headers={
"x-api-key": "YOUR_API_KEY"
},
json={
"emailType": "Email Type"
}
).json()
curl --location --request POST "https://api.okaya.me/interact/groups/1710748366424/email" \
--header "x-api-key: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"emailType": "Email Type"
}'
Example Response
200
{ "message": "success" }
400
- Invalid 'groupID'
- Group not found
- Invalid group
- Invalid 'emailType'
{ "error": "You are missing the path parameter groupID" | "groupID must be a number" }
{ "error": "Group not found" }
{ "error": "Group doesn't exist in associated groups" }
{ "error": "You are missing the body parameter emailType" | "Invalid email type. Should be one of ['checkinReminder', 'privacyRequest']." }
401: Unauthorized
Send Email to Participant
POST /interact/participants/{externalID}/email
Send an email to a specific participant. Keep in mind only participants that have the relevant email preference enabled will receive this email.
Currently supported email types are checkinReminder
, which reminds a participant to complete a check-in, and privacyRequest
, which requests a privacy preference review.
Headers
{ "x-api-key": "YOUR_API_KEY" }
URL Parameters
externalID
(required): The external identifier for the participant.
Body
{ "emailType": "checkinReminder" | "privacyRequest" }
Example Call
- JavaScript
- Python
- cURL
await fetch(
"https://api.okaya.me/interact/participants/ok_participant1/email",
{
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
},
body: JSON.stringify({
emailType: "Email Type",
}),
}
).then((response) => response.json());
import requests
requests.post("https://api.okaya.me/interact/participants/ok_participant1/email",
headers={
"x-api-key": "YOUR_API_KEY"
},
json={
"emailType": "Email Type"
}
).json()
curl --location --request POST "https://api.okaya.me/interact/participants/ok_participant1/email" \
--header "x-api-key: YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"emailType": "Email Type"
}'
Example Response
200
{ "message": "success" }
400
- Invalid 'externalID'
- Participant not found
- Invalid 'emailType'
{ "error": "You are missing the path parameter externalID" }
{ "error": "Participant not found" }
{ "error": "You are missing the body parameter emailType" | "Invalid email type. Should be one of ['checkinReminder', 'privacyRequest']." }