cURL
curl --request POST \ --url 'https://api.onesignal.com/notifications?c=sms' \ --header 'Authorization: <authorization>' \ --header 'Content-Type: application/json' \ --data '{ "app_id": "YOUR_APP_ID", "contents": { "en": "<string>" }, "include_aliases": { "external_id": [ "<string>" ], "onesignal_id": [ "<string>" ] }, "target_channel": "sms", "include_subscription_ids": [ "<string>" ], "include_phone_numbers": [ "<string>" ], "included_segments": [ "<string>" ], "excluded_segments": [ "<string>" ], "filters": [ { "field": "first_session", "key": "<string>", "relation": ">", "value": "1" } ], "sms_from": "<string>", "sms_media_urls": [ "<string>" ], "name": "<string>", "template_id": "<string>", "custom_data": {}, "send_after": "<string>", "delayed_option": "<string>", "delivery_time_of_day": "<string>", "idempotency_key": "<string>" }'
{ "id": "<string>", "external_id": "<string>", "errors": { "invalid_phone_numbers": [ "<string>" ], "invalid_aliases": { "external_id": [ "[\"user_id_1\", \"user_id_1\", \"user_id_2\"]" ], "onesignal_id": [ "[\"1589641e-bed1-4325-bce4-d2234e578884\", \"1589641e-bed1-4325-bce4-d2234e578884\", \"1589641e-bed1-4325-bce4-d2234e578884\"]" ] }, "invalid_player_ids": [ "<string>" ] } }
Send a message using the SMS channel.
contents
{{'your_url' | track_link}}
{ "contents": { "en": "Hi, here's my link: {{'https://example.com' | track_link}} " } }
1sgnl.co/XXXX
Your App API key with prefix Key. See Keys & IDs.
Key
200
The response is of type object.
object