Groups


The groups resource is very basic. All of the active groups you've reserved through the TextCarrier dashboard are available through the API. The following actions can be performed on this resource...

Retrieve All Groups

By default, the first set of 20 groups will be returned, but you can modify this number with limit and offset values in the query string. The max limit for a single request is 10,000.

GET https://api.textcarrier.com/v1/groups?limit=30&offset=0

Example response:


      {
           "meta":{
              "limit":20,
              "offset":0,
              "total":1,
              "self":"https://api.textcarrier.com/v1/groups"
           },
           "links":{
              "self":"https://api.textcarrier.com/v1/groups"
           },
           "groups":[
              {
                 "id":24223543,
                 "groupName":"School Alerts",
                 "groupKeyword":"alerts",
                 "groupAutoReply":"Thanks for subscribing to the New Valley School alerts system. Stay tuned for updates and more info.",
                 "created":"2016-02-20 13:21:49",
                 "subscriberCount":764,
                 "optoutCount":23
              }
           ]
        }
        

Retrieve a Specific Group

Retrieves the single group with the id equal to {id}

GET https://api.textcarrier.com/v1/groups/{id}

Example response:


      {
           "links":{
              "self":"https://api.textcarrier.com/v1/groups/24223543"
           },
           "group":{
                "id":24223543,
                "groupName":"School Alerts",
                "groupKeyword":"alerts",
                "groupAutoReply":"Thanks for subscribing to the New Valley School alerts system. Stay tuned for updates and more info.",
                "created":"2016-02-20 13:21:49",
                "subscriberCount":764,
                "optoutCount":23
           }
        }
       

Retrieve a Group's Subscribers

Retrieves all subscribers associated with the group with id equal to {id}. See subscribers for more information.

GET https://api.textcarrier.com/v1/groups/{id}/subscribers

Example response:


       {
           "meta":{
              "limit":20,
              "offset":0,
              "total":1
           },
           "links":{
              "self":"https://api.textcarrier.com/v1/subscribers/group=24223543"
           },
           "subscribers":[
              {
                 "id":999354382,
                 "number":"+15554443443",
                 "firstName":"Ryan",
                 "lastName":"Smith",
                 "city":null,
                 "state":null,
                 "zipCode":null,
                 "country":null,
                 "birthDate":null,
                 "group":24223543,
                 "subscribedDate":"2017-02-20 13:22:29",
                 "email":""
              }
           ]
        }
       

Retrieve a Group's Messages

Retrieves all messages associated with the group with id equal to {id}. See messages for more information.

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

Example response:


      {
           "meta":{
              "limit":20,
              "offset":0,
              "total":1
           },
           "links":{
              "self":"https://api.textcarrier.com/v1/messages/group=24223543"
           },
           "messages":[
              {
                 "id":2236355334,
                 "name":"School Cancellations",
                 "body":"Attention parents... After school activitites are cancelled due to the snow / poor road conditions. See you tomorrow!",
                 "mediaUrl":null,
                 "groups":null,
                 "subscriberId":null,
                 "isAutoReply":0,
                 "isStandardMessage":1,
                 "isPollMessage":0,
                 "count":432,
                 "sent":"2017-03-02 18:20:18",
                 "scheduled":null,
                 "status":"sent",
                 "reasonFailed":null
              }
           ]
        }