Create an SMS campaign
POST /sms_campaigns
/sms_campaignsCreates an SMS campaign as a draft: message, SMS sender, recipients and tracking are saved, but no SMS is sent. To be valid it needs a title, an audience, send_to (with groups, contact_segment or filter when needed) and sms_config with the message and an active sms_sender. Only contacts with a confirmed SMS subscription and a phone number receive it.
When to use: To prepare a text message for an audience, some of its groups, a contact segment or a filter of its own. Afterwards check it with get_sms_campaign (recipient_count), send a preview with send_sms_campaign_test, and then send it (send_sms_campaign_now) or schedule it (schedule_sms_campaign).
When not to use: For email use create_campaign. To start from an existing SMS campaign, use duplicate_sms_campaign.
Side effects: Nothing is sent to anyone.
Permissions: Requires the author role or higher, or the marketing.campaigns.write capability. Choosing contact_segment or filter also requires the contacts.read capability.
Value for the X-Auth-Token header parameter.
In: header
The new SmsCampaign resource
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.easymailing.com/sms_campaigns" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "send_to": "send_to_all", "list_segment": "/entity/1", "sms_config": { "message": "string", "sms_sender": "/entity/1" }, "sms_campaign_config": { "track_clicks": true, "track_ecommerce": true, "track_google_analytics": true, "google_analytics_tag": "string" }, "contact_segment": "/entity/1", "filter": { "match": "all", "conditions": [ { "field": "string", "operator": "string", "value": null, "audience": "0ff0092a-9631-4ad5-a4dd-fe4329a52f3b", "match": "all", "conditions": [ {} ] } ] }, "title": "string", "audience": "/entity/1", "groups": [ "/entity/1" ] }'{ "sms_config": { "message": "string", "sms_sender": "/entity/1" }, "sms_campaign_config": { "track_clicks": true, "track_ecommerce": true, "track_google_analytics": true, "google_analytics_tag": "string" }, "sms_campaign_stats": { "sent": 0, "delivered": 0, "failed": 0, "failed_rate": 0.1, "unsubscribed": 0, "replies": 0, "credits_consumed": 0, "credits_reserved": 0, "delivery_rate": 0.1, "clicked": 0, "click_rate": 0.1, "to_send": 0 }, "id": 0, "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "title": "string", "status": "campaign.status.draft", "type": "campaign.regular", "channel": "sms", "send_to": "string", "audience": "string", "list_segment": "/entity/1", "groups": [ "string" ], "hash": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "started_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z", "contact_targeting": { "kind": "segment", "contact_segment": "/entity/1", "contact_segment_name": "string", "contact_segment_deleted": true, "revision_status": "following_latest", "pinned_at": "2019-08-24T14:15:22Z", "error_code": "string", "filter": { "match": "all", "conditions": [ { "field": "string", "operator": "string", "value": null, "audience": "0ff0092a-9631-4ad5-a4dd-fe4329a52f3b", "match": "all", "conditions": [ {} ] } ] } }}