Learn how to send transactional messages like OTPs, billing updates, and reminders using OneSignal’s API with personalized data via push, email, or SMS.
other_user_id
, facebook_id
, etc.) across your systems. For email and SMS, you can also send messages directly using the email address or phone number respectively.
include_aliases
to target the recommended external_id
or other aliases like so:
include_subscription_ids
property. This option is not recommended because Users can have multiple Subscriptions.
include_email_tokens
property.
Any emails included that do not exist within your OneSignal app will automatically create a new email subscription.
include_phone_numbers
property.
Any phone numbers included that do not exist within your OneSignal app will automatically create a new SMS subscription.
custom_data
to the message using Templates and Liquid syntax.
Steps to add custom data:
{{ message.custom_data.order_id }}
) to your template.template_id
and custom_data
within your Create Message API call.verification_code
on your server when the user requests access.verification_code
value into the API request.custom_data
you can input the variable value directly into the message with string concatenation. For example:
include_aliases
, the alias must be registered on the user beforehand.