Messages


Message are all the outgoing interaction you've had with your subscribers through SlickText. All your auto-replies, sent campaigns, and messages to individual subscribers can be accessed via the API. The following actions can be performed on this resource...

Retrieve All Messages

Retrieves all messages associated with your account. This is for all textwords and subscribers. By default, the first set of 20 textwords will be returned, but you can modify this number with the limit and offset values in the query string. The max limit for a single request is 10,000.

You may also want to filter your results by the date and time your messages were sent. You can do this by passing the sentAfter and / or sentBefore query string parameters. The values should be url encoded, in the format of YYYY-MM-DD HH:MM:SS, and in the Pacific Timezone (America/Los_Angeles).

GET https://api.slicktext.com/v1/messages?limit=30&offset=10

Example response:


      {
            "meta":
            {
                "limit": 30,
                "offset": 10,
                "total": 1
            },
            "links":
            {
                "self": "https:\/\/api.slicktext.com\/v1\/messages\/"
            },
            "messages":
            [
                {
                    "id": 11111,
                    "campaign": "API demo",
                    "body": "ALL THE MESSAGES. https://slkt.io/oFa6",
                    "textword": 111,
                    "autoReply": 0,
                    "count": 1,
                    "deleted": 0,
                    "sent": "2013-06-23 20:52:42",
                    "scheduled": null,
                    "contact": null,
                    "source": null,
                    "shortlinks":
                    [
                        {
                            id: 10,
                            "name": "Link Name",
                            "url": "https://www.slicktext.com",
                            "hash": "oFa6",
                            "clickCount": 123,
                            "isSmart": 1,
                            "created": "2021-03-18 12:43:26",
                            "shortUrl": "https://slkt.io/oFa6"
                        }
                    ]
                }
            ]
        }
        

Retrieve a Specific Message

Retrieves the single message with an ID equal to {id}.

GET https://api.slicktext.com/v1/messages/{id}

Example response:


      {
            "links":
            {
                "self": "https:\/\/api.slicktext.com\/v1\/messages\/11111"
            },
            "message":
            {
                "id": 11111,
                "campaign": "API demo",
                "body": "Getting a message by ID https://slkt.io/oFa6",
                "textword": 111,
                "contact": null,
                "count": 100,
                "sent": "2013-06-23 20:52:42",
                "deleted": 0,
                "autoReply": 0,
                "scheduled": null,
                "shortlinks":
                [
                    {
                        id: 10,
                        "name": "Link Name",
                        "url": "https://www.slicktext.com",
                        "hash": "oFa6",
                        "clickCount": 123,
                        "isSmart": 1,
                        "created": "2021-03-18 12:43:26",
                        "shortUrl": "https://slkt.io/oFa6"
                    }
                ]
            }
        }
        

Send a Message

Immediately sends a campaign / text message blast to the provided textword OR contact.

POST https://api.slicktext.com/v1/messages/

Arguments

Parameter Description
action (mandatory) The action for this specific request type is SEND. This must be included or the request will fail.
textword (mandatory) The ID of the textword to which you want to send to. This will send the message to the entire textword list. Either a textword ID or contact ID is required.

In addition, you may include a number as well as a textword ID. If this is the case, and the number has not already been opted out of text messages from your account, the number will be opted in as a contact to that textword (without an auto reply), and the message will be sent to that contact only. When doing this, you may also provide other contact-specific information as detailed in the contacts documentation.
contact (mandatory) The ID of the contact to which you want to send to. This will send the message to that specific contact only. Either a contact ID or a textword ID is required.
body (mandatory) The body of the text message you want to send. The string length may not exceed the max number of characters set on your account. That may be 132, 160 or 320. Reference the account resource to see how you can find your account's character limit. By default, its 160 unless a SlickText team member has changed it for you.
campaign The name of the campaign / message that you are sending. End users will not see this.
segment The ID of the textword segment that you are sending to. Reference the textwords resource to learn how to retrieve a textword's segments.
mediaUrl A publicly accessible url for any piece of rich media that you want to include with your message. When this parameter is used, your message is no longer an SMS but an MMS message. MMS messages allow between 600 and 1,600 characters in length depending on type of number that you're sending from.

Supported file types are: jpg, jpeg, png, and gif. Other formats may work but are not guaranteed. All files must be 590 kb or less in size and return a HTTP status of 200.

It's also important to note that your file should be hosted in a place where it can be accessed heavily and at a fast rate. Our platform will retrieve your file once per subscriber and up to a rate of 250 concurent requests per second.

Example response:


        {
            "meta":
            {
                "success": true
            },
            "links":
            {
                "self": "https:\/\/api.slicktext.com\/v1\/messages\/11111"
            },
            "message":
            {
                "id": 11111,
                "campaign": "API demo",
                "body": "Sending a message. https://slkt.io/oFa6",
                "mediaUrl" : "https://www.slicktext.com/images/logos/logo_color_light.svg",
                "textword": 111,
                "contactID": null,
                "count": 100,
                "sent": "2013-06-23 20:52:42",
                "deleted": 0,
                "autoReply": 0,
                "scheduled": null,
                "shortlinks":
                [
                    {
                        id: 10,
                        "name": "Link Name",
                        "url": "https://www.slicktext.com",
                        "hash": "oFa6",
                        "clickCount": 123,
                        "isSmart": 1,
                        "created": "2021-03-18 12:43:26",
                        "shortUrl": "https://slkt.io/oFa6"
                    }
                ]
            }
        }
        

Schedule a Message

Schedule a campaign / text message to be sent in the future to the provided textword OR contact.

POST https://api.slicktext.com/v1/messages/

Arguments

Parameter Description
action (mandatory) The action for this specific request type is SCHEDULE. This must be included or the request will fail.
textword (mandatory) The ID of the textword to which you want to send to. This will send the message to the entire textword list. Either a textword ID or contact ID is required.

In addition, you may include a number as well as a textword ID. If this is the case, and the number has not already been opted out of text messages from your account, the number will be opted in as a contact to that textword (without an auto reply), and the message will be sent to that contact only. When doing this, you may also provide other contact-specific information as detailed in the contacts documentation.
contact (mandatory) The ID of the contact to which you want to send to. This will send the message to that specific contact only. Either a contact ID or a textword ID is required.
body (mandatory) The body of the text message you want to send. The string length may not exceed the max number of characters set on your account. That may be 132, 160 or 320. Reference the account resource to see how you can find your account's character limit. By default, its 160 unless a SlickText team member has changed it for you.
scheduled (mandatory) The time stamp at which to send the message. This should be in local time and in the format: YYYY-MM-DD HH:MM:SS. Scheduled messages only send every 15 minutes and therefore can only be scheduled every 15 minutes. We expect the minute of your time stamp to be either 00, 15, 30, or 45.
campaign The name of the campaign / message that you are sending. End users will not see this.
segment The ID of the textword segment that you are sending to. Reference the textwords resource to learn how to retrieve a textword's segments.
mediaUrl A publicly accessible url for any piece of rich media that you want to include with your message. When this parameter is used, your message is no longer an SMS but an MMS message. MMS messages allow between 600 and 1,600 characters in length depending on type of number that you're sending from.

Supported file types are: jpg, jpeg, png and gif. Other formats may work but are not guaranteed. All files must be 590 kb or less in size and return a HTTP status of 200.

It's also important to note that your file should be hosted in a place where it can be accessed heavily and at a fast rate. Our platform will retrieve your file once per subscriber and up to a rate of 250 concurent requests per second.

Example response:


        {
            "meta":
            {
                "success": true
            },
            "links":
            {
                "self": "https:\/\/api.slicktext.com\/v1\/messages\/11111"
            },
            "message":
            {
                "id": 11111,
                "campaign": "API demo",
                "body": "Sending a message. https://slkt.io/oFa6",
                "mediaUrl" : "https://www.slicktext.com/images/logos/logo_color_light.svg",
                "textword": 111,
                "contactID": null,
                "count": 100,
                "sent": "2013-06-23 20:45:00",
                "deleted": 0,
                "autoReply": 0,
                "scheduled": "2013-06-23 20:45:00",
                "shortlinks":
                [
                    {
                        id: 10,
                        "name": "Link Name",
                        "url": "https://www.slicktext.com",
                        "hash": "oFa6",
                        "clickCount": 123,
                        "isSmart": 1,
                        "created": "2021-03-18 12:43:26",
                        "shortUrl": "https://slkt.io/oFa6"
                    }
                ]
            }
        }
        

Delete a Message

Removes the unsent, scheduled, or failed message with an ID equal to {id}. Messages that have already been sent cannot be removed.

POST https://api.slicktext.com/v1/messages/{id}

Arguments

Parameter Description
action (mandatory) The action for this specific request type is DELETE. This must be included or the request will fail.

Example response:


        {
            "meta":
            {
                "success":true
            }
        }
        

Retrieve a Message's Send Log

Retrieves a record of which contacts this message was sent to and the delivery status of each text message.

This endpoint works differently from other SlickText API endpoints. The only query string filter that's supported is to. Additionally, with paging, if there is another page of data, the isLastPage meta value will be true. You must then pass the nextPageKey value to get the next page.

Please note that a message that is still sending will be creating log items as it goes. As the message is processed by carriers, the status of these records will be updated.

There are four possible delivery statuses:

Status Description
failed The message was unsuccessfully sent to the carrier. This is usually due to a number being bad.
sent to carrier The message was sent to the carrier for delivery. This is an intermediate step during which the carrier is processing the message and sending it to the handset. If we do not receive delivery or non-delivery confirmation, a message will remain in this state.
delivered The message was successfully delivery to the handset.
undelivered The message failed to deliver to the handset. The could be because the phone number is invalid, the device was unreachable at the time of send, the message was flagged for spam or some other unknown reason.

Please note that log data is only available for messages that were sent after March 15th, 2021. Additionally, this data expires 12 months after creation.

GET https://api.slicktext.com/v1/messages/{id}/log
GET https://api.slicktext.com/v1/messages/{id}/log?pageKey=BDR::1234589::p9a8weuhfouawbhefp98yhef

Example response:


        {
            "meta": {
                "success": 1,
                "isLastPage": 1,
                'nextPageKey': "BDR::1234589::p9a8weuhfouawbhefp98yhef"
            },
            "links": {
                "self": "http://local.api.slicktext.com/v1/messages/43512013/log",
                "message": "http://local.api.slicktext.com/v1/messages/43512013"
            },
            "items": [
                {
                    "contact": 12341234,
                    "to": "+15554443232",
                    "from": "+15552224343",
                    "status": "delivered",
                    "created": "2021-03-24 06:51:15",
                    "updated": "2021-03-24 06:51:17"
                }
            ]
        }
        

You're in excellent hands. Some of the world's greatest companies develop with our SMS API.