Text Messaging


Search Number

Search owned text messaging numbers.

Endpoint

Method URI Description
GET /users/{user_id}/text_numbers Search user owned text numbers

Example Response

{
    "data": [
        {
            "id": 1,
            "owner_type": "users",
            "owner_id": 1,
            "provider": "Twilio",
            "phone_number": "+1234567890",
            "name": "Phone Number Name",
            "description": null,
            "reply_action": "Standard",
            "reply_forward_to": null,
            "reply_text": null,
            "call_action": "Forward",
            "call_forward_to": "1234567890",
            "status": "Active",
            "created_at": "2019-10-17T02:04:28Z",
            "updated_at": "2019-10-17T02:04:59Z",
            "deleted_at": null
        }
    ],
    "links": {
        "first": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers?page=1",
        "last": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers",
        "per_page": 15,
        "to": 1,
        "total": 1
    }
}

Create Number

Create a text message number.

Endpoint

Method URI Description
POST /users/{user_id}/text_numbers Create a a text message number

Body Params

{
    "provider": "Twilio",
    "phone_number": "+1234567890",
    "name": "Phone Number Name",
    "description": null,
    "reply_action": "Standard",
    "reply_forward_to": null,
    "reply_text": null,
    "call_action": "Forward",
    "call_forward_to": "1234567890"
}

Example Response

{
    "id": 1,
    "owner_type": "users",
    "owner_id": 1,
    "provider": "Twilio",
    "phone_number": "+1234567890",
    "name": "Phone Number Name",
    "description": null,
    "reply_action": "Standard",
    "reply_forward_to": null,
    "reply_text": null,
    "call_action": "Forward",
    "call_forward_to": "1234567890",
    "status": "Active",
    "created_at": "2019-10-17T02:04:28Z",
    "updated_at": "2019-10-17T02:04:59Z",
    "deleted_at": null
}

Read Number

Retrieve a text message number.

Endpoint

Method URI Description
GET /text_numbers/{number_id} Retrieve a number by it's id

Example Response

{
    "id": 1,
    "owner_type": "users",
    "owner_id": 1,
    "provider": "Twilio",
    "phone_number": "+1234567890",
    "name": "Phone Number Name",
    "description": null,
    "reply_action": "Standard",
    "reply_forward_to": null,
    "reply_text": null,
    "call_action": "Forward",
    "call_forward_to": "1234567890",
    "status": "Active",
    "created_at": "2019-10-17T02:04:28Z",
    "updated_at": "2019-10-17T02:04:59Z",
    "deleted_at": null
}

Update Number

Update a text messaging number.

Endpoint

Method URI Description
PUT /text_numbers/{number_id} Update a number

Body Params

{
    "name": "Phone Number Name",
    "description": null,
    "reply_action": "Standard",
    "reply_forward_to": null,
    "reply_text": null,
    "call_action": "Forward",
    "call_forward_to": "1234567890"
}

Example Response

{
    "id": 1,
    "owner_type": "users",
    "owner_id": 1,
    "provider": "Twilio",
    "phone_number": "+1234567890",
    "name": "Phone Number Name",
    "description": null,
    "reply_action": "Standard",
    "reply_forward_to": null,
    "reply_text": null,
    "call_action": "Forward",
    "call_forward_to": "1234567890",
    "status": "Active",
    "created_at": "2019-10-17T02:04:28Z",
    "updated_at": "2019-10-17T02:04:59Z",
    "deleted_at": null
}

Delete Number

Delete a text message number.

Endpoint

Method URI Description
DELETE /text_numbers/{number_id} Delete a number by it's id

Example Response

{
    "success": true
}

Search Channel

Search owned text messaging channels.

Endpoint

Method URI Description
GET /users/{user_id}/text_channels Search user owned text channels

Example Response

{
    "data": [
        {
            "id": 1,
            "owner_type": "users",
            "owner_id": 1,
            "text_number_id": 1,
            "name": "Channel Name",
            "subject": "Channel Subject",
            "description": "Channel description",
            "greeting_with_first_name": "Hi { {c.first_name} },",
            "greeting_without_first_name": "Hi,",
            "body": "Body of message",
            "text": "Text representation of message body",
            "status": "Saved",
            "reason": null,
            "send_type": null,
            "send_at": null,
            "sending_at": null,
            "sent_at": null,
            "recipients": [],
            "exclusions": null,
            "text_number": null,
            "reporting": null,
            "created_at": "2020-01-30T14:10:07Z",
            "updated_at": "2020-01-30T14:10:07Z",
            "deleted_at": null,
            "unread_threads": 0
        }
    ],
    "links": {
        "first": "http://myauth.happygrasshopper.com/v3/users/77179/text_channels?page=1",
        "last": "http://myauth.happygrasshopper.com/v3/users/77179/text_channels?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://myauth.happygrasshopper.com/v3/users/77179/text_channels",
        "per_page": 15,
        "to": 1,
        "total": 1
    }
}

Create Channel

Create a text message channel.

Endpoint

Method URI Description
POST /users/{user_id}/text_channels Create a a text message channel

Body Params

{
    "name": "Channel Name",
    "subject": "Channel Subject",
    "description": "Channel description",
    "greeting_with_first_name": "Hi { {c.first_name} },",
    "greeting_without_first_name": "Hi,",
    "body": "Body of message",
    "text": "Text representation of message body",
    "status": "Saved",
    "send_type": null,
    "send_at": null,
    "recipients": [],
    "exclusions": null
}

Example Response

{
    "id": 1,
    "owner_type": "users",
    "owner_id": 1,
    "text_number_id": 1,
    "name": "Channel Name",
    "subject": "Channel Subject",
    "description": "Channel description",
    "greeting_with_first_name": "Hi { {c.first_name} },",
    "greeting_without_first_name": "Hi,",
    "body": "Body of message",
    "text": "Text representation of message body",
    "status": "Saved",
    "reason": null,
    "send_type": null,
    "send_at": null,
    "sending_at": null,
    "sent_at": null,
    "recipients": [],
    "exclusions": null,
    "text_number": null,
    "reporting": null,
    "created_at": "2020-01-30T14:10:07Z",
    "updated_at": "2020-01-30T14:10:07Z",
    "deleted_at": null,
    "unread_threads": 0
}

Read Channel

Retrieve a text message channel.

Endpoint

Method URI Description
GET /text_channels/{channel_id} Retrieve a channel by it's id

Example Response

{
    "id": 1,
    "owner_type": "users",
    "owner_id": 1,
    "text_number_id": 1,
    "name": "Channel Name",
    "subject": "Channel Subject",
    "description": "Channel description",
    "greeting_with_first_name": "Hi { {c.first_name} },",
    "greeting_without_first_name": "Hi,",
    "body": "Body of message",
    "text": "Text representation of message body",
    "status": "Saved",
    "reason": null,
    "send_type": null,
    "send_at": null,
    "sending_at": null,
    "sent_at": null,
    "recipients": [],
    "exclusions": null,
    "text_number": null,
    "reporting": null,
    "created_at": "2020-01-30T14:10:07Z",
    "updated_at": "2020-01-30T14:10:07Z",
    "deleted_at": null,
    "unread_threads": 0
}

Update Channel

Update a text messaging channel.

Endpoint

Method URI Description
PUT /text_channels/{channel_id} Update a channel

Body Params

{
    "name": "Channel Name",
    "subject": "Channel Subject",
    "description": "Channel description",
    "greeting_with_first_name": "Hi { {c.first_name} },",
    "greeting_without_first_name": "Hi,",
    "body": "Body of message",
    "text": "Text representation of message body",
    "status": "Saved",
    "send_type": null,
    "send_at": null,
    "recipients": [],
    "exclusions": null
}

Example Response

{
    "id": 1,
    "owner_type": "users",
    "owner_id": 1,
    "text_number_id": 1,
    "name": "Channel Name",
    "subject": "Channel Subject",
    "description": "Channel description",
    "greeting_with_first_name": "Hi { {c.first_name} },",
    "greeting_without_first_name": "Hi,",
    "body": "Body of message",
    "text": "Text representation of message body",
    "status": "Saved",
    "reason": null,
    "send_type": null,
    "send_at": null,
    "sending_at": null,
    "sent_at": null,
    "recipients": [],
    "exclusions": null,
    "text_number": null,
    "reporting": null,
    "created_at": "2020-01-30T14:10:07Z",
    "updated_at": "2020-01-30T14:10:07Z",
    "deleted_at": null,
    "unread_threads": 0
}

Delete Channel

Delete a text message channel.

Endpoint

Method URI Description
DELETE /text_channels/{number_id} Delete a channel by it's id

Example Response

{
    "success": true
}

Channel Threads

Index threads inside a sent text messaging channel.

Endpoint

Method URI Description
GET /text_channels/{channel_id}/threads Index threads inside sent channel

Example Response

{
    "data": [
        {
            "id": 1,
            "text_channel_id": 1,
            "receiver_type": "contacts",
            "receiver_id": 1,
            "last_replied_at": "2019-11-28T16:53:49Z",
            "last_read_at": null,
            "is_unread": true
        }
    ],
    "links": {
        "first": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers?page=1",
        "last": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers",
        "per_page": 15,
        "to": 1,
        "total": 1
    }
}

Contact Messages

Index messages to a contact using a text messaging number.

Endpoint

Method URI Description
GET /text_numbers/{number_id}/contacts/{contact_id} Index messages sent to a contact

Example Response

{
    "data": [
        {
            "id": 1,
            "text_channel_id": null,
            "thread_id": null,
            "sender_type": "users",
            "sender_id": 1,
            "sender_phone": "+1234567890",
            "receiver_type": "contacts",
            "receiver_id": 1,
            "receiver_phone": "+1234567890",
            "body": "Message body",
            "status": "Delivered",
            "reason": null,
            "provider": "Twilio",
            "provider_id": "someidentifier",
            "created_at": "2019-11-15T22:50:15Z",
            "updated_at": "2019-11-15T22:50:37Z",
            "deleted_at": null
        }
    ],
    "links": {
        "first": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers?page=1",
        "last": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://myauth.happygrasshopper.com/v3/users/77179/text_numbers",
        "per_page": 15,
        "to": 1,
        "total": 1
    }
}

Send Contact Messages

Send a message to a contact.

Endpoint

Method URI Description
POST /text_numbers/{number_id}/contacts/{contact_id} Send a message to a specific contact

Body Params

{
    "body": "Message body here ..."
}

Example Response

{
    "id": 1,
    "text_channel_id": null,
    "thread_id": null,
    "sender_type": "users",
    "sender_id": 1,
    "sender_phone": "+1234567890",
    "receiver_type": "contacts",
    "receiver_id": 1,
    "receiver_phone": "+1234567890",
    "body": "Message body",
    "status": "Delivered",
    "reason": null,
    "provider": "Twilio",
    "provider_id": "someidentifier",
    "created_at": "2019-11-15T22:50:15Z",
    "updated_at": "2019-11-15T22:50:37Z",
    "deleted_at": null
}