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.

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.",
                    "textword": 111,
                    "autoReply": 0,
                    "count": 1,
                    "deleted": 0,
                    "sent": "2013-06-23 20:52:42",
                    "scheduled": null,
                    "contact": null,
                    "source": null
                }
            ]
        }
        

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",
                "textword": 111,
                "contact": null,
                "count": 100,
                "sent": "2013-06-23 20:52:42",
                "deleted": 0,
                "autoReply": 0,
                "scheduled": null
            }
        }
        

Send a Message

Immediately sends a campaign / message 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 message are allowed up to 1,200 characters in length regardless of the character limit imposed on your account.

Supported file types are: jpg, jpeg, png, gif, pdf. Other formats may work but are not guaranteed. All files must be 490 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.",
                "mediaUrl" : "https://www.slicktext.com/images/logo_main.png",
                "textword": 111,
                "contactID": null,
                "count": 100,
                "sent": "2013-06-23 20:52:42",
                "deleted": 0,
                "autoReply": 0,
                "scheduled": null
            }
        }
        

Schedule a Message

Schedule a campaign / 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 America/Los_Angeles time stamp at which to send the message. Scheduled messages only send every 15 minutes and therefore can only be scheduled every 15 minutes.
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 message are allowed up to 1,200 characters in length regardless of the character limit imposed on your account.

Supported file types are: jpg, jpeg, png, gif, pdf. Other formats may work but are not guaranteed. All files must be 490 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.",
                "mediaUrl" : "https://www.slicktext.com/images/logo_main.png",
                "textword": 111,
                "contactID": null,
                "count": 100,
                "sent": "2013-06-23 20:45:00",
                "deleted": 0,
                "autoReply": 0,
                "scheduled": "2013-06-23 20:45:00"
            }
        }
        

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
            }
        }
        

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