Emma API Documentation

SMS

These endpoints allow for users to get information about their sms campaigns.

GET /#account_id/sms/campaigns

Get sms campaigns for account.

This endpoint will return a list of sms campaigns for the account ID.

Returns :A response with a list of of campaigns for the given account ID.

Sample Response [showhide]
GET /100/sms/campaigns
[
    {
        "account_id": 100,
        "archived_at": null,
        "bounces": 0,
        "canceled_by_user_id": null,
        "copied_from_sms_campaign_id": null,
        "created_at": "2023-09-05T16:22:17.738757+00:00",
        "deliveries": 0,
        "from_phone_number": "+12345678910",
        "is_promotional": true,
        "is_test": false,
        "media_url": null,
        "message": "Hi this is a test",
        "message_segments": 0,
        "opt_outs": 0,
        "pending_at": null,
        "recipients": {
            "groups": [
                1234
            ],
            "members": [],
            "segments": [],
            "suppression_segments": []
        },
        "results_message": null,
        "scheduled_at": null,
        "scheduled_by_user_id": null,
        "send_finished": null,
        "send_started": null,
        "send_status": "d",
        "shorten_links": false,
        "sms_campaign_id": 123,
        "sms_campaign_name": "Test SMS Campaign",
        "sms_campaign_type": "m",
        "total_clicks": 0,
        "total_sent": 0,
        "unique_clicks": 0,
        "updated_at": "2023-09-05T16:23:43.498598+00:00"
    }
]
                                
GET /#account_id/sms/campaigns/#campaign_id

Get specific sms campaign.

This endpoint will return a campaign for the account that matches the given campaign ID.

Returns :A response with a campaign for a specified campaign ID.
Raises :Http404 if the given campaign id for that account does not exist.

Sample Response [showhide]
GET /100/sms/campaigns/123
{
    "account_id": 100,
    "archived_at": null,
    "bounces": 0,
    "canceled_by_user_id": null,
    "copied_from_sms_campaign_id": null,
    "created_at": "2023-09-05T16:22:17.738757+00:00",
    "deliveries": 2,
    "from_phone_number": "+12345678910",
    "is_promotional": true,
    "is_test": false,
    "media_url": null,
    "message": "Hi this is a test",
    "message_segments": 0,
    "opt_outs": 0,
    "pending_at": null,
    "recipients": {
        "groups": [
            1234
        ],
        "members": [],
        "segments": [],
        "suppression_segments": []
    },
    "results_message": null,
    "scheduled_at": null,
    "scheduled_by_user_id": null,
    "send_finished": null,
    "send_started": null,
    "send_status": "d",
    "shorten_links": false,
    "sms_campaign_id": 123,
    "sms_campaign_name": "Test SMS Campaign",
    "sms_campaign_type": "m",
    "total_clicks": 0,
    "total_sent": 0,
    "unique_clicks": 0,
    "updated_at": "2023-09-05T16:23:43.498598+00:00"
}
                                
GET /#account_id/sms/campaigns/#campaign_id/deliveries

Get a list of deliveries for an sms campaign.

This endpoint will return a list of deliveries for the given campaign ID.

Returns :A response with a list of deliveries for a specified campaign ID.
Raises :Http404 if the given campaign id for that account does not exist.

Sample Response [showhide]
GET /100/sms/campaigns/123/deliveries
[
    {
        "account_id": 100,
        "bounce_type": null,
        "delivery_type": "d",
        "from_phone_number": "+12345678910",
        "member_id": 110,
        "opted_out_at": null,
        "sms_campaign_id": 123,
        "to_phone_number": "+11098765432"
    },
    {
        "account_id": 100,
        "bounce_type": null,
        "delivery_type": "d",
        "from_phone_number": "+12345678910",
        "member_id": 111,
        "opted_out_at": null,
        "sms_campaign_id": 123,
        "to_phone_number": "+11098765433"
    }
]
                                
GET /#account_id/sms/campaigns/#campaign_id/clicks

Get a list of clicks for an sms campaign.

This endpoint will return a list of clicks for the given campaign ID.

Returns :A response with a list of clicks for a specified campaign ID.
Raises :Http404 if the given campaign id for that account does not exist.

Sample Response [showhide]
GET /100/sms/campaigns/123/clicks
[
    {
        "click_timestamp": "2023-03-31T18:19:28.547464+00:00",
        "member_id": 110,
        "sms_campaign_id": 123,
        "sms_link_id": 43,
        "sms_link_target": "http://www.meetmarigold.com",
        "to_phone_number": "+11098765432"
    },
    {
        "click_timestamp": "2023-03-31T18:19:22.383613+00:00",
        "member_id": 111,
        "sms_campaign_id": 123,
        "sms_link_id": 43,
        "sms_link_target": "http://www.meetmarigold.com",
        "to_phone_number": "+11098765433"
    }
]
                                
GET /#account_id/sms/billing/credit_usage

Get sms credit usage for account.

This endpoint will return the credit usage for the account ID. You must specify query parameters 'from_date' and 'to_date'. The returned credit usage is inclusive of the 'from_date' and exclusive of the 'to_date'. The dates are based in the UTC timezone.

Parameters:
  • from_date (string) – Required. The start date of the requested credit usage in ISO format (YYYY-MM-DD)
  • to_date (string) – Required. The end date of the requested credit usage in ISO format (YYYY-MM-DD)
Returns :A response with an integer that is the credit usage for the given account ID.

Sample Response [showhide]
GET /100/sms/billing/credit_usage?from_date=2023-03-22&to_date=2024-01-29
123
                                

Related Topics

Interested in Emma?

Emma's email marketing makes communicating simple and stylish. Get started today.